pixelfed/app/Events/AuthLoginEvent.php
2018-08-28 03:07:36 +00:00

34 lines
644 B
PHP

<?php
namespace App\Events;
use App\User;
use App\UserSetting;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class AuthLoginEvent
{
use Dispatchable, InteractsWithSockets, SerializesModels;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct()
{
//
}
public function handle(User $user)
{
if (empty($user->settings)) {
$settings = new UserSetting();
$settings->user_id = $user->id;
$settings->save();
}
}
}