I am trying to trigger an event whenever an user is created but but this error pops up.
<?php
namespace App\Events;
use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
class NewUser
{
use Dispatchable, InteractsWithSockets, SerializesModels;
/**
* Create a new event instance.
*
* @return void
*/
use SerializesModels;
public $user;
public function __construct(App\User $user)
{
//
$this->user = $user;
}
}
I have tried searching for this __sleep function but I can't find it, and I've also tired various things with using use App\User
int the top vs in the function parameter itself.
What is the issue?