Skip to content

Commit 8846355

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 394b306 + bec4ab7 commit 8846355

File tree

8 files changed

+61
-21
lines changed

8 files changed

+61
-21
lines changed

.github/workflows/dependabot-auto-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
- name: Dependabot metadata
1515
id: metadata
16-
uses: dependabot/fetch-metadata@v2.0.0
16+
uses: dependabot/fetch-metadata@v2.1.0
1717
with:
1818
github-token: "${{ secrets.GITHUB_TOKEN }}"
1919

.github/workflows/fix-php-code-style-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
ref: ${{ github.head_ref }}
2020

2121
- name: Fix PHP code style issues
22-
uses: aglipanci/laravel-pint-action@2.3.1
22+
uses: aglipanci/laravel-pint-action@2.4
2323

2424
- name: Commit changes
2525
uses: stefanzweifel/git-auto-commit-action@v5

.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: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,35 @@
99

1010
**Laravel Pay Pocket** is a package designed for Laravel applications, offering the flexibility to manage multiple wallet types within two dedicated database tables, `wallets` and `wallets_logs`.
1111

12-
**Demo** https://github.com/HPWebdeveloper/demo-pay-pocket
12+
**Demo:** https://github.com/HPWebdeveloper/demo-pay-pocket
13+
14+
**Videos:**
15+
16+
- [Laravel Pay Pocket Package: Virtual Wallets in Your Project](https://www.youtube.com/watch?v=KoQyURiwsA4)
17+
18+
- [Laravel Exceptions: Why and How to Use? Practical Example.](https://www.youtube.com/watch?v=-Sr18w91v8Q)
19+
20+
- [PHP Enums in Laravel: Practical Example from Package](https://www.youtube.com/watch?v=iUOb-3HQtK8)
21+
1322

1423
**Note:** This package does not handle payments from payment platforms, but instead offers the concept of virtual money, deposit, and withdrawal.
1524

1625
- **Author**: Hamed Panjeh
1726
- **Vendor**: hpwebdeveloper
1827
- **Package**: laravel-pay-pocket
1928
- **Alias name**: Laravel PPP (Laravel Pay Pocket Package)
20-
- **Version**: `1.x`
29+
- **Version**: `2.x`
2130
- **PHP Version**: 8.1+
22-
- **Laravel Version**: `10.x`
31+
- **Laravel Version**: `10.x`, `11.x`
2332
- **[Composer](https://getcomposer.org/):** `composer require hpwebdeveloper/laravel-pay-pocket`
2433

2534
### Support Policy
2635

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 | | | | | |
36+
| Version | Laravel | PHP | Release date | End of improvements | End of support |
37+
|-------------------------------------------------|--------------|-------------|---------------|---------------------| -------------- |
38+
| 1.x | ^10.0 | 8.1, 8.2, 8.3 | Nov 30, 2023 | Mar 1, 2024 | |
39+
| 2.x | ^10.0, ^11.0 |8.2, 8.3| June 27, 2024 | January 30, 2025 | |
40+
| 3.x (atomic operations and restricted wallets) | ^11.0 |8.2, 8.3| comming soon | | |
3141

3242
## Installation:
3343

@@ -199,7 +209,7 @@ you will discover a variety of exceptions tailored to address each scenario of i
199209
### Log
200210

201211
A typical `wallets_logs` table.
202-
![Laravel Pay Pocket Log](https://github.com/HPWebdeveloper/laravel-pay-pocket/assets/16323354/a242d335-8bd2-4af1-aa38-4e95b8870941)
212+
![Laravel Pay Pocket Log](https://github.com/HPWebdeveloper/laravel-pay-pocket/assets/16323354/0d7f2237-88e1-4ac0-a4f2-ac200bad9273)
203213

204214
## Testing
205215

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": "^10.0"
21+
"illuminate/contracts": "^10.0 || ^11.0"
2222
},
2323
"require-dev": {
2424
"laravel/pint": "^1.0",

config/pay-pocket.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
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: 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.
1919
|
20-
| This is how it works by default in the code:
20+
| By default, the following generator is set up:
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',

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)