Skip to content

Commit 58d8b96

Browse files
authored
Merge branch 'main' into features
2 parents ad327c2 + 46f8261 commit 58d8b96

File tree

6 files changed

+61
-22
lines changed

6 files changed

+61
-22
lines changed

.github/workflows/run-tests.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest, windows-latest]
16-
php: [8.1, 8.2, 8.3]
17-
laravel: [10.*]
16+
php: [8.2, 8.3]
17+
laravel: [10.*, 11.*]
1818
stability: [prefer-lowest, prefer-stable]
1919
include:
2020
- laravel: 10.*
2121
testbench: 8.*
2222
carbon: ^2.63
23+
php: 8.1
24+
- laravel: 11.*
25+
testbench: 9.*
26+
carbon: ^3.0
27+
php: 8.2
2328

2429
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2530

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22

33
All notable changes to `laravel-pay-pocket` will be documented in this file.
44

5+
## 2.2.0 - 2024-06-27
6+
7+
### What's Changed
8+
9+
* Update: Change log_reference_length to log_reference_params by @3m1n3nc3 in https://github.com/HPWebdeveloper/laravel-pay-pocket/pull/34
10+
* Modify comments by @HPWebdeveloper in https://github.com/HPWebdeveloper/laravel-pay-pocket/pull/36
11+
12+
**Full Changelog**: https://github.com/HPWebdeveloper/laravel-pay-pocket/compare/2.1.0...2.2.0
13+
14+
## 2.1.0 - 2024-06-27
15+
16+
### What's Changed
17+
18+
* Bump aglipanci/laravel-pint-action from 2.3.1 to 2.4 by @dependabot in https://github.com/HPWebdeveloper/laravel-pay-pocket/pull/26
19+
* Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 by @dependabot in https://github.com/HPWebdeveloper/laravel-pay-pocket/pull/27
20+
* Add check Laravel 11 compatibility by @HPWebdeveloper in https://github.com/HPWebdeveloper/laravel-pay-pocket/pull/28
21+
* Test over the correct php version by @HPWebdeveloper in https://github.com/HPWebdeveloper/laravel-pay-pocket/pull/29
22+
* Support Laravel 11 by @samehdoush in https://github.com/HPWebdeveloper/laravel-pay-pocket/pull/25
23+
24+
### New Contributors
25+
26+
* @samehdoush made their first contribution in https://github.com/HPWebdeveloper/laravel-pay-pocket/pull/25
27+
28+
**Full Changelog**: https://github.com/HPWebdeveloper/laravel-pay-pocket/compare/2.0.3...2.1.0
29+
530
## 2.0.3 - 2024-04-12
631

732
### What's Changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717
- **Vendor**: hpwebdeveloper
1818
- **Package**: laravel-pay-pocket
1919
- **Alias name**: Laravel PPP (Laravel Pay Pocket Package)
20-
- **Version**: `1.x`
20+
- **Version**: `2.x`
2121
- **PHP Version**: 8.1+
22-
- **Laravel Version**: `10.x`
22+
- **Laravel Version**: `10.x`, `11.x`
2323
- **[Composer](https://getcomposer.org/):** `composer require hpwebdeveloper/laravel-pay-pocket`
2424

2525
### Support Policy
2626

27-
| Version | Laravel | PHP | Release date | End of improvements | End of support |
28-
| ------- | ------- | ------------- | ------------ | ------------------- | -------------- |
29-
| 1.x | ^10.0 | 8.1, 8.2, 8.3 | Nov 30, 2023 | Mar 1, 2024 | |
30-
| x.x | | | | | |
27+
| Version | Laravel | PHP | Release date | End of improvements | End of support |
28+
|---------|--------------|-------------|---------------|---------------------| -------------- |
29+
| 1.x | ^10.0 | 8.1, 8.2, 8.3 | Nov 30, 2023 | Mar 1, 2024 | |
30+
| 2.x | ^10.0, ^11.0 |8.2, 8.3| June 27, 2024 | January 30, 2025 | |
3131

3232
## Installation:
3333

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": "^8.1",
2020
"spatie/laravel-package-tools": "^1.14.0",
21-
"illuminate/contracts": "^11.0"
21+
"illuminate/contracts": "^10.0 || ^11.0"
2222
},
2323
"require-dev": {
2424
"laravel/pint": "^1.0",

config/pay-pocket.php

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,27 @@
22

33
// config for HPWebdeveloper/LaravelPayPocket
44

5-
/**
6-
* The 'log_reference_generator' should be a numeric array with three elements:
7-
* - The first element should be the fully qualified name of a class that contains static methods.
8-
* This includes the namespace of the class.
9-
* - The second element should be the name of a static method available in the specified class.
10-
* - The third element should be an array of optional parameters to pass to the static method.
11-
* For example, the default generator is configured as follows:
12-
* [\Illuminate\Support\Str::class, 'random', [12]], which uses the 'random' static method
13-
* from the \Illuminate\Support\Str class with 12 as a parameter.
14-
*/
155
return [
16-
'log_reference_length' => 12,
6+
7+
/*
8+
|--------------------------------------------------------------------------
9+
| Reference Generator Configuration
10+
|--------------------------------------------------------------------------
11+
|
12+
| This configuration allows you to customize the generation of log reference strings
13+
| within the LaravelPayPocket package.
14+
|
15+
| - [array] log_reference_params: An array of parameters to pass to the log_reference_generator_method.
16+
| - [string] log_reference_prefix: Prefix for the generated reference string.
17+
| - [class-string] log_reference_generator_class: Fully qualified name of the class containing static methods for generation.
18+
| - [string] log_reference_generator_method: Name of the static method available in the generator class.
19+
|
20+
| By default, the following generator is set up:
21+
| Illuminate\Support\Str::random(12)
22+
|
23+
*/
24+
25+
'log_reference_params' => [12],
1726
'log_reference_prefix' => '',
1827
'log_reference_generator_class' => Illuminate\Support\Str::class,
1928
'log_reference_generator_method' => 'random',

src/Traits/BalanceOperation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ 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

7777
return $prefix.$reference;
7878
}

0 commit comments

Comments
 (0)