activity-timeline icon indicating copy to clipboard operation
activity-timeline copied to clipboard

[Bug]: The package doesnt work with Relation::enforceMorphMap()

Open misbahansori opened this issue 11 months ago • 0 comments

What happened?

When I'm using the Relation::enforceMorphMap() method on the AppServiceProvider, the package doesn't work as expected. No result is returned on the activity page.

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

The query from that page is looks like this:

select * from `activity_log` where `subject_id` = 1 and `subject_type` = 'App\Models\User' order by `created_at` desc

It uses the class name instead of the morph map alias.

How to reproduce the bug

Use the Relation::enforceMorphMap() method on the AppServiceProvider

Package Version

^1.2

PHP Version

8.2.10

Laravel Version

^10.10

Which operating systems does with happen with?

No response

Notes

No response

misbahansori avatar Mar 08 '24 07:03 misbahansori