phpvms/app/Models/Observers/UserObserver.php
2019-07-16 13:54:14 -04:00

27 lines
448 B
PHP

<?php
namespace App\Models\Observers;
use App\Models\User;
use App\Services\UserService;
class UserObserver
{
private $userSvc;
public function __construct(UserService $userSvc)
{
$this->userSvc = $userSvc;
}
/**
* After a user has been created, do some stuff
*
* @param User $user
*/
public function created(User $user): void
{
$this->userSvc->findAndSetPilotId($user);
}
}