first commit

This commit is contained in:
2025-03-07 00:29:07 -06:00
commit b21a11c2ee
564 changed files with 94041 additions and 0 deletions

View File

@ -0,0 +1,25 @@
<?php
namespace Koneko\VuexyAdmin\Listeners;
use Illuminate\Auth\Events\Logout;
use Illuminate\Support\Facades\Log;
use Koneko\VuexyAdmin\Services\VuexyAdminService;
class ClearUserCache
{
/**
* Handle the event.
*
* @return void
*/
public function handle(Logout $event)
{
if ($event->user) {
VuexyAdminService::clearUserMenuCache();
VuexyAdminService::clearSearchMenuCache();
VuexyAdminService::clearQuickLinksCache();
VuexyAdminService::clearNotificationsCache();
}
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace Koneko\VuexyAdmin\Listeners;
use Illuminate\Auth\Events\Login;
use Illuminate\Support\Facades\Mail;
use Koneko\VuexyAdmin\Models\UserLogin;
class HandleUserLogin
{
public function handle(Login $event)
{
// Guardar log en base de datos
UserLogin::create([
'user_id' => $event->user->id,
'ip_address' => request()->ip(),
'user_agent' => request()->header('User-Agent'),
]);
// Actualizar el último login
$event->user->update(['last_login_at' => now(), 'last_login_ip' => request()->ip()]);
// Enviar notificación de inicio de sesión
//Mail::to($event->user->email)->send(new LoginNotification($event->user));
}
}