File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ class Invoice extends Model {
9393 protected function casts(): array
9494 {
9595 return [
96- 'amount' => MoneyCast::class . ': currency'
96+ 'amount' => MoneyCast::of(' currency')
9797 ];
9898 }
9999}
@@ -117,8 +117,8 @@ class Invoice extends Model {
117117 protected function casts(): array
118118 {
119119 return [
120- 'cost' => MoneyCast::class . ': EUR',
121- 'price' => MoneyCast::class . ': USD'
120+ 'cost' => MoneyCast::of(' EUR') ,
121+ 'price' => MoneyCast::of(' USD')
122122 ];
123123 }
124124}
Original file line number Diff line number Diff line change 2727 "nunomaduro/collision" : " ^8.1.1||^7.10.0" ,
2828 "larastan/larastan" : " ^3.0" ,
2929 "orchestra/testbench" : " ^8.22.0||^9.0.0||^10.0.0" ,
30- "pestphp/pest" : " ^3.0" ,
31- "pestphp/pest-plugin-arch" : " ^3.0" ,
32- "pestphp/pest-plugin-laravel" : " ^3.0" ,
30+ "pestphp/pest" : " ^3.0||^4.0 " ,
31+ "pestphp/pest-plugin-arch" : " ^3.0||^4.0 " ,
32+ "pestphp/pest-plugin-laravel" : " ^3.0||^4.0 " ,
3333 "phpstan/extension-installer" : " ^1.3||^2.0" ,
3434 "phpstan/phpstan-deprecation-rules" : " ^1.1||^2.0" ,
3535 "phpstan/phpstan-phpunit" : " ^1.3||^2.0"
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ public function __construct(
2929 // No initialization required
3030 }
3131
32+ public static function of (string $ currencyOrAttribute ): string
33+ {
34+ return static ::class.': ' .$ currencyOrAttribute ;
35+ }
36+
3237 /**
3338 * @param array<string, mixed> $attributes The model's attributes.
3439 */
You can’t perform that action at this time.
0 commit comments