Closed webmastervinay closed 9 years ago
You should import the activty-model instead of the facade.
Make sure you have
use Spatie\Activitylog\Models\Activity;
at the top of your file.
Hello,
I am using it in UserController. I put use Spatie\Activitylog\Models\Activity it in very first line and now it is fetching the records in one of the function.
But now the Activity::log('logged out'); which is also in same UserController (logout method) is not working. It shows Call to undefined method Illuminate\Database\Query\Builder::log().
Both are not working in same controller.
When importing two objects with the same name from different namespaces you should alias one of the two.
More info: http://php.net/manual/en/language.namespaces.importing.php
Hello,
I am able to store the activity log without any issue. But when i am trying to fetch it by following lines
$latestActivities = Activity::with('user')->latest()->limit(100)->get();
I am getting issue as below:
Call to undefined method Spatie\Activitylog\ActivitylogSupervisor::with()
Can you please help??