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 custom casters to caster factory #984

Open
brendt opened this issue Mar 9, 2025 · 0 comments
Open

Add custom casters to caster factory #984

brendt opened this issue Mar 9, 2025 · 0 comments
Labels

Comments

@brendt
Copy link
Member

brendt commented Mar 9, 2025

Add the ability to add custom casters for specific types to the caster factory. One common example is Carbon, which should have a CarbonCaster. Instead of having to add #[CastWith] on every Carbon property, you'd like a package or project to define it once. Something like:

$casterFactory->addCaster(Carbon::class, CarbonCaster::class);
@brendt brendt added the Mapper label Mar 9, 2025
@brendt brendt added this to the v1.0.0-alpha.6 milestone Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant