Skip to content

Commit

Permalink
fix when using with multiple panels
Browse files Browse the repository at this point in the history
  • Loading branch information
atmonshi committed Oct 19, 2023
1 parent 99068d0 commit f458111
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace RyanChandler\FilamentNavigation\Filament\Resources\NavigationResource\Pages;

use Filament\Facades\Filament;
use Filament\Resources\Pages\CreateRecord;
use RyanChandler\FilamentNavigation\Filament\Resources\NavigationResource;
use RyanChandler\FilamentNavigation\Filament\Resources\NavigationResource\Pages\Concerns\HandlesNavigationBuilder;
use RyanChandler\FilamentNavigation\FilamentNavigation;

Expand All @@ -12,6 +14,10 @@ class CreateNavigation extends CreateRecord

public static function getResource(): string
{
return FilamentNavigation::get()->getResource();
if (Filament::hasPlugin('navigation')) {
return FilamentNavigation::get()->getResource();
}

return NavigationResource::class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace RyanChandler\FilamentNavigation\Filament\Resources\NavigationResource\Pages;

use Filament\Facades\Filament;
use Filament\Resources\Pages\EditRecord;
use RyanChandler\FilamentNavigation\Filament\Resources\NavigationResource;
use RyanChandler\FilamentNavigation\Filament\Resources\NavigationResource\Pages\Concerns\HandlesNavigationBuilder;
use RyanChandler\FilamentNavigation\FilamentNavigation;

Expand All @@ -12,6 +14,10 @@ class EditNavigation extends EditRecord

public static function getResource(): string
{
return FilamentNavigation::get()->getResource();
if (Filament::hasPlugin('navigation')) {
return FilamentNavigation::get()->getResource();
}

return NavigationResource::class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@
namespace RyanChandler\FilamentNavigation\Filament\Resources\NavigationResource\Pages;

use Filament\Actions\CreateAction;
use Filament\Facades\Filament;
use Filament\Resources\Pages\ListRecords;
use RyanChandler\FilamentNavigation\Filament\Resources\NavigationResource;
use RyanChandler\FilamentNavigation\FilamentNavigation;

class ListNavigations extends ListRecords
{
public static function getResource(): string
{
return FilamentNavigation::get()->getResource();
if (Filament::hasPlugin('navigation')) {
return FilamentNavigation::get()->getResource();
}

return NavigationResource::class;
}

protected function getActions(): array
Expand Down

0 comments on commit f458111

Please sign in to comment.