mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-18 12:31:27 +00:00
40 lines
716 B
PHP
40 lines
716 B
PHP
<?php
|
|
|
|
namespace App\Listeners;
|
|
|
|
use DB;
|
|
use App\User;
|
|
use App\UserSetting;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
class AuthLogin
|
|
{
|
|
/**
|
|
* Create the event listener.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Handle the event.
|
|
*
|
|
* @param object $event
|
|
* @return void
|
|
*/
|
|
public function handle($event)
|
|
{
|
|
$user = $event->user;
|
|
if (empty($user->settings)) {
|
|
DB::transaction(function() use($user) {
|
|
UserSetting::firstOrCreate([
|
|
'user_id' => $user->id
|
|
]);
|
|
});
|
|
}
|
|
}
|
|
}
|