Laravel activitylog, implementation error

0

I'm following the site documentation: link , but I'm not getting it implement the option below:

Setting a subject You can specify on which object the activity is performed by using performedOn:

activity()
   ->performedOn($someContentModel)
   ->log('edited');

$lastActivity = Activity::all()->last(); //returns the last logged activity

$lastActivity->subject; //returns the model that was passed to 'performedOn';
The performedOn-function has a shorter alias name: on

When I try to pass the parameters in the controller it generates error in performedOn($someContentModel) , I would like to know what I should use instead of the $ someContentModel variable.

    
asked by anonymous 07.08.2018 / 20:23

1 answer

1

You should use the "return" of a MODEL your .. ex:

$someContentModel = User::first();
    
07.08.2018 / 21:05