File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1212 | This configuration allows you to customize the generation of log reference strings
1313 | within the LaravelPayPocket package.
1414 |
15- | - log_reference_length : The length of the generated reference string .
16- | - log_reference_prefix: The prefix for the generated reference string.
17- | - log_reference_generator_class: The fully qualified name of the class containing static methods for generation.
18- | - log_reference_generator_method: The name of the static method available in the generator class.
15+ | - [array] log_reference_params : The parameters to pass to the log reference generator .
16+ | - [string] log_reference_prefix: The prefix for the generated reference string.
17+ | - [class-string] log_reference_generator_class: The fully qualified name of the class containing static methods for generation.
18+ | - [string] log_reference_generator_method: The name of the static method available in the generator class.
1919 |
2020 | This is how it works by default in the code:
2121 | Illuminate\Support\Str::random(12)
2222 |
2323 */
2424
25- 'log_reference_length ' => 12 ,
25+ 'log_reference_params ' => [ 12 ] ,
2626 'log_reference_prefix ' => '' ,
2727 'log_reference_generator_class ' => Illuminate \Support \Str::class,
2828 'log_reference_generator_method ' => 'random ' ,
Original file line number Diff line number Diff line change @@ -65,15 +65,15 @@ protected function generateReference(): string
6565 {
6666 $ className = config ('pay-pocket.log_reference_generator_class ' );
6767 $ methodName = config ('pay-pocket.log_reference_generator_method ' );
68- $ length = config ('pay-pocket.log_reference_length ' );
68+ $ params = ( array ) config ('pay-pocket.log_reference_params ' , [ 12 ] );
6969 $ prefix = config ('pay-pocket.log_reference_prefix ' );
7070
7171 if (! is_callable ([$ className , $ methodName ])) {
7272 throw new InvalidArgumentException ('Invalid configuration: The combination of log_reference_generator_class and log_reference_generator_method is not callable. ' );
7373 }
7474
75- $ reference = call_user_func ([$ className , $ methodName ], $ length );
75+ $ reference = call_user_func ([$ className , $ methodName ], ... $ params );
7676
77- return $ prefix. $ reference ;
77+ return $ prefix . $ reference ;
7878 }
7979}
You can’t perform that action at this time.
0 commit comments