Laravel-activitylog: Subject type set to table name instead of model

Created on 14 Sep 2017  路  7Comments  路  Source: spatie/laravel-activitylog

When using the activity logger on my 'Article' model I get the table name as subject instead of the Model. I tried changing the name of the model and this worked. Also changing the namespace of the model worked for me.

How come it doesn't work when the namespace is App\Article ?

Most helpful comment

@sander-tjuna Have you made your own morphMap for that Article model maybe?

All 7 comments

Could you give us some code that is failing for you?

@freekmurze I'm using the trait on my model, just as I use it on all my other models. So I can't really provide code.

Can you PR a failing test?

@sander-tjuna Have you made your own morphMap for that Article model maybe?

@bbashy thanks! this was the culprit other developer had left this behind in the appserviceprovider (the morphmap). It was doing nothing. Thanks for pointing me (us @sander-tjuna) there!

@GioChocolateBro Good to hear. It did sound like that was the problem :)

馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kcristella picture kcristella  路  5Comments

ianrussel picture ianrussel  路  5Comments

Hesesses picture Hesesses  路  5Comments

lucianobosco picture lucianobosco  路  5Comments

hackel picture hackel  路  5Comments