You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
maybe anyone tried to make cast for laravel Attribute?
In my case I'm trying to cast $value to MoneyAttribute
class CommissionDTO extends Data
{
publicfunction__construct(
publicarray$consultant,
#[WithCast(MoneyAttributeCast::class)]
publicMoneyAttribute$liValue,
) {
}
}
I'm getting:
TypeError : Tests\DataTransferObjects\CommissionDTO::__construct(): Argument #2 ($liValue) must be of type App\Attributes\MoneyAttribute, int given, called in
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
maybe anyone tried to make cast for laravel Attribute?
In my case I'm trying to cast $value to
MoneyAttribute
I'm getting:
Beta Was this translation helpful? Give feedback.
All reactions