Skip to content

Commit

Permalink
403 - fix condition for AdminPanelProvider #2
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrakovich committed Apr 18, 2024
1 parent 2ce09e8 commit 06c799e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/Providers/AdminPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\Support\Facades\App;
use Illuminate\View\Middleware\ShareErrorsFromSession;

class AdminPanelProvider extends PanelProvider
{
public function register(): void
{
$rootPath = strtok(request()->path(), '/');
if (App::runningInConsole() || in_array($rootPath, ['admin', 'livewire', 'filament'])) {
$artisanCommand = $_SERVER['argv'][1] ?? null;
if (in_array($rootPath, ['admin', 'livewire', 'filament']) || $artisanCommand === 'route:cache') {
parent::register();
}
}
Expand Down

0 comments on commit 06c799e

Please sign in to comment.