Skip to content

Commit

Permalink
rename getDynamicSlug => getDynamicDefaultSlug
Browse files Browse the repository at this point in the history
  • Loading branch information
rez1dent3 committed Dec 28, 2023
1 parent 428d3ab commit ed81f3f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* build(deps): bump axios from 1.6.2 to 1.6.3 by @dependabot in https://github.com/bavix/laravel-wallet/pull/821

### Added
* add wallet getDynamicSlug by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/822
* add wallet getDynamicDefaultSlug by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/822

## [10.0.2] - 2023-12-14
### Bump
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/MorphOneWallet.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function wallet(): MorphOne
->withDefault(static function (WalletModel $wallet, object $holder) use ($castService) {
$model = $castService->getModel($holder);

$slug = method_exists($model, 'getDynamicSlug')
? $model->getDynamicSlug()
$slug = method_exists($model, 'getDynamicDefaultSlug')
? $model->getDynamicDefaultSlug()
: config('wallet.wallet.default.slug', 'default');

$wallet->forceFill(array_merge(config('wallet.wallet.creating', []), [
Expand Down
2 changes: 1 addition & 1 deletion tests/Infra/Models/UserDynamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getTable(): string
return 'users';
}

public function getDynamicSlug(): string
public function getDynamicDefaultSlug(): string
{
return 'default-' . $this->email;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Units/Domain/WalletTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public function testDefaultWalletCustomize(): void
self::assertSame(1, $wallet->meta['internal'] ?? 0);
}

public function testGetDynamicSlug(): void
public function testgetDynamicDefaultSlug(): void
{
/** @var UserDynamic $user */
$user = UserDynamicFactory::new()->create();
Expand Down

0 comments on commit ed81f3f

Please sign in to comment.