File tree 2 files changed +8
-8
lines changed 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 12
12
| This configuration allows you to customize the generation of log reference strings
13
13
| within the LaravelPayPocket package.
14
14
|
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.
19
19
|
20
20
| This is how it works by default in the code:
21
21
| Illuminate\Support\Str::random(12)
22
22
|
23
23
*/
24
24
25
- 'log_reference_length ' => 12 ,
25
+ 'log_reference_params ' => [ 12 ] ,
26
26
'log_reference_prefix ' => '' ,
27
27
'log_reference_generator_class ' => Illuminate \Support \Str::class,
28
28
'log_reference_generator_method ' => 'random ' ,
Original file line number Diff line number Diff line change @@ -65,15 +65,15 @@ protected function generateReference(): string
65
65
{
66
66
$ className = config ('pay-pocket.log_reference_generator_class ' );
67
67
$ 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 ] );
69
69
$ prefix = config ('pay-pocket.log_reference_prefix ' );
70
70
71
71
if (! is_callable ([$ className , $ methodName ])) {
72
72
throw new InvalidArgumentException ('Invalid configuration: The combination of log_reference_generator_class and log_reference_generator_method is not callable. ' );
73
73
}
74
74
75
- $ reference = call_user_func ([$ className , $ methodName ], $ length );
75
+ $ reference = call_user_func ([$ className , $ methodName ], ... $ params );
76
76
77
- return $ prefix. $ reference ;
77
+ return $ prefix . $ reference ;
78
78
}
79
79
}
You can’t perform that action at this time.
0 commit comments