60 lines
1.7 KiB
PHP
60 lines
1.7 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Modules\Core;
|
||
|
|
|
||
|
|
use Filament\Contracts\Plugin;
|
||
|
|
use Filament\Navigation\NavigationItem;
|
||
|
|
use Filament\Panel;
|
||
|
|
use Illuminate\Support\Facades\Mail;
|
||
|
|
use Lunar\Admin\Filament\Resources\StaffResource;
|
||
|
|
use Lunar\Admin\Models\Staff as LunarStaff;
|
||
|
|
use Lunar\Admin\Support\Facades\LunarPanel;
|
||
|
|
use Modules\Core\Auth\Extensions\StaffResourceExtension;
|
||
|
|
use Modules\Core\Auth\Filament\Pages\Login;
|
||
|
|
use Modules\Core\Auth\Mail\InviteMail;
|
||
|
|
|
||
|
|
class CorePlugin implements Plugin
|
||
|
|
{
|
||
|
|
public function getId(): string
|
||
|
|
{
|
||
|
|
return 'core';
|
||
|
|
}
|
||
|
|
|
||
|
|
public function register(Panel $panel): void
|
||
|
|
{
|
||
|
|
$panel->path('boboko')
|
||
|
|
->brandName('Boboko')
|
||
|
|
->brandLogo(asset('logos/core/boboko-logo.svg'))
|
||
|
|
->darkModeBrandLogo(asset('logos/core/boboko-logo-white.svg'))
|
||
|
|
->login(Login::class)
|
||
|
|
->navigationItems([
|
||
|
|
NavigationItem::make("Lucent")
|
||
|
|
->url("/lucent")
|
||
|
|
->icon("heroicon-o-sun")
|
||
|
|
->group("Content")
|
||
|
|
->sort(1),
|
||
|
|
]);
|
||
|
|
|
||
|
|
LunarPanel::extensions([
|
||
|
|
StaffResource::class => StaffResourceExtension::class,
|
||
|
|
]);
|
||
|
|
|
||
|
|
LunarStaff::addActivitylogExcept([
|
||
|
|
'otp_code',
|
||
|
|
'otp_expires_at',
|
||
|
|
'password',
|
||
|
|
'remember_token',
|
||
|
|
'email_verified_at',
|
||
|
|
'two_factor_secret',
|
||
|
|
'two_factor_recovery_codes',
|
||
|
|
'two_factor_confirmed_at',
|
||
|
|
]);
|
||
|
|
|
||
|
|
LunarStaff::created(function (LunarStaff $staff) {
|
||
|
|
Mail::to($staff->email)->send(new InviteMail($staff->first_name));
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
public function boot(Panel $panel): void {}
|
||
|
|
}
|