Skip to content

[8.x] Only add getRouteKeyName to models when collection uses slugs#677

Merged
duncanmcclean merged 1 commit into8.xfrom
fix/route-key-in-generated-migration
Mar 31, 2025
Merged

[8.x] Only add getRouteKeyName to models when collection uses slugs#677
duncanmcclean merged 1 commit into8.xfrom
fix/route-key-in-generated-migration

Conversation

@duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Mar 31, 2025

This pull request fixes an issue with the collection importer, where the getRouteKeyName method would be added to Eloquent models, even when the slugs weren't enabled on the source collection.

This would cause a 404 when viewing models in the Control Panel.

Related: #675 (comment)

@duncanmcclean duncanmcclean merged commit 4e7c71c into 8.x Mar 31, 2025
36 checks passed
@duncanmcclean duncanmcclean deleted the fix/route-key-in-generated-migration branch March 31, 2025 10:31
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.

1 participant