Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add castable docs #5934

Merged
merged 2 commits into from
Apr 1, 2020
Merged

Add castable docs #5934

merged 2 commits into from
Apr 1, 2020

Conversation

brendt
Copy link
Contributor

@brendt brendt commented Apr 1, 2020

@taylorotwell taylorotwell merged commit db7b86a into laravel:7.x Apr 1, 2020
@taylorotwell
Copy link
Member

taylorotwell commented Apr 1, 2020

In hindsight it probably would have been nice to pass array $arguments to the Castable object too, so that you from within castUsing you could use an anonymous class...

public static function castUsing(array $arguments)
{
     return new class(...$arguments) implements CastsAttributes {
        get;
        set;
     }
}

I would suggest adding that to 8.x IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants