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

Ability to use morphed map model with custom path generator #3143

Merged

Conversation

petyots
Copy link
Contributor

@petyots petyots commented Jan 4, 2023

This add the ability to to use morphed map model enforced by Eloquent enforce morph map

Relation::enforceMorphMap([
    'user' => User::class,       
 ]);

Now you can do:

'custom_path_generators' => [
        'user' => \App\Domain\Media\Support\UserPathGenerator::class,
    ],

@freekmurze
Copy link
Member

Nice one, thanks!

@freekmurze freekmurze merged commit 228503a into spatie:main Jan 4, 2023
@petyots petyots deleted the custom-path-generator-morph-map-fix branch January 4, 2023 15:19
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.

2 participants