fix(01-01): use morphMap instead of enforceMorphMap to avoid breaking Spatie
- Changed from enforceMorphMap to morphMap in AppServiceProvider - enforceMorphMap was causing errors with Spatie Laravel Permission package - morphMap still provides namespace protection for our custom models - Adds comment explaining why we don't enforce strict mapping
This commit is contained in:
@@ -23,8 +23,10 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function boot(): void
|
public function boot(): void
|
||||||
{
|
{
|
||||||
// Register morph map to protect against namespace refactoring
|
// Register morph map for custom polymorphic models
|
||||||
Relation::enforceMorphMap([
|
// Note: We use morphMap() instead of enforceMorphMap() to avoid breaking
|
||||||
|
// third-party packages (like Spatie Laravel Permission) that use polymorphic relationships
|
||||||
|
Relation::morphMap([
|
||||||
'member' => Member::class,
|
'member' => Member::class,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user