spatie / activitylog

A very simple activity logger to monitor the users of your website or application
https://spatie.be/opensource/laravel
MIT License
582 stars 75 forks source link

Sentinel #2

Closed ChristopherDosin closed 9 years ago

ChristopherDosin commented 9 years ago

What is the best way to change the User Facade to Sentinel ?

e.g https://github.com/freekmurze/activitylog/blob/master/src/Spatie/Activitylog/ActivitylogSupervisor.php#L41-L46

Should i create a __construct somewhere and override this function ? Or how should i change it ?

Because if i want to pass the user_id i get a

FatalErrorException in ActivitylogSupervisor.php line 45:
Class 'User' not found
$user = Sentinel::getUser();
Activity::log('Report ' . $report->id . ' wurde erstellt von', $user->id);
freekmurze commented 9 years ago

Hi,

I think that if you pass your own object to the log function that the id property will be used to store the activity. Could you try passing your own user object to the log function instead of just the id?

If it doesn't work out, I'll take a closer look.

freekmurze commented 9 years ago

I assume your problem has been solved. If not, feel free to reopen this issue.