mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 08:44:49 +00:00
37 lines
816 B
PHP
37 lines
816 B
PHP
|
<?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;
|
||
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||
|
use App\{User, UserSetting};
|
||
|
|
||
|
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();
|
||
|
}
|
||
|
}
|
||
|
}
|