9 months ago (790,130 XP)

Just convert the object to an array, and log the array

Log::info((array) $event);

Personally, I'd be pulling properties that I want to log off the $event object and log those, not the entire event object, which can provide way more info than you're looking for (and really create large log files)


That worked, thanks @Cronix

It logs the User Model

'events' => 
    array (
     'observables' => 
    array (
     'relations' => 
    array (

I tried to log the FollowedPartner Event:

public function follow(Partner $partner, User $user, FollowedPartner $event){

        Log::info('Something happened');

        return redirect()->route('', $partner)->with('info', 'Followed.');

How can I log this event, to see if the Event Listener works, because at the moment it won't store any records within my points_adjustments table. The process is that a User gets awarded Points for following a Partner.

The follow functionality works, but nothing will be stored within the points table

        public function awardPoints($event, $points, User $user){   
        $adjustment = new PointAdjustment([
                'event' => get_class($event),
                'points' => $points,
            return $this-> pointsAdjustments()->save($adjustment);

Please sign in or create an account to participate in this conversation.