First Commit
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Lunar\Admin\Support\Facades\LunarPanel;
|
||||
use Modules\Core\Auth\Filament\Pages\Login;
|
||||
use Modules\Core\CorePlugin;
|
||||
|
||||
class PanelServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
if (! $this->isAdminRequest()) {
|
||||
return;
|
||||
}
|
||||
|
||||
LunarPanel::panel(function (\Filament\Panel $panel) {
|
||||
return $panel
|
||||
->login(Login::class)
|
||||
->plugin(new CorePlugin());
|
||||
});
|
||||
|
||||
LunarPanel::disableTwoFactorAuth();
|
||||
LunarPanel::register();
|
||||
}
|
||||
|
||||
private function isAdminRequest(): bool
|
||||
{
|
||||
if ($this->app->runningInConsole()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$path = request()->path();
|
||||
|
||||
return str_starts_with($path, 'boboko')
|
||||
|| str_starts_with($path, 'livewire');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user