Is the event fired after?, because if it is, you can't uso 'echo' I think. If before event doesn't work either, try to not depend on events (on this one) and use a function call instead.
After some more tries/tests i did it by overwriting the save method. I still don't know what's wrong with the code from my first post it it works now. Thank you!
does "boot function called" appears?
try replacing static::saving with self::saving
Laravel hooks listen for a true/false response to be returned from them. Try:
static::saving(function($model)
{
if (Sentry::check())
{
$model->user_id = Sentry::getUser()->getId();
return true;
}
return false;
});
Good luck :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community