Not be able to show a resource file with same model in different panels.
i have implement two panels in my code
In the
Now i implemented the same thing for my
```
<?php
namespace App\Filament\Owner\Resources;
use App\Filament\Owner\Resources\UserResource\Pages;
use App\Filament\Owner\Resources\UserResource\RelationManagers;
use App\Models\User;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class UserResource extends Resource
{
protected static ?string $model = User::class;
protected static ?string $panel = 'owner';
protected static ?string $navigationIcon = 'heroicon-o-users';
protected static ?string $navigationGroup = 'Settings';
protected static ?string $navigationLabel = 'Users';
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery();
}
public static function shouldRegisterNavigation(): bool
{
return true;
}
public static function canViewNavigation(): bool
{
return true;
}
public static function table(Table $table): Table
{
return $table
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}
public static function getPages(): array
{
return [
'index' => Pages\ListUsers::route('/'),
'create' => Pages\CreateUser::route('/create'),
'edit' => Pages\EditUser::route('/{record}/edit'),
];
}
}
Note: i have removed the unnecessary code due to the text limit.
admin and onwer .In the
admin panel i have implemented the user resource file with the user model. which is working fine.Now i implemented the same thing for my
owner panel but it is not showing in the navigation bar.```
<?php
namespace App\Filament\Owner\Resources;
use App\Filament\Owner\Resources\UserResource\Pages;
use App\Filament\Owner\Resources\UserResource\RelationManagers;
use App\Models\User;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class UserResource extends Resource
{
protected static ?string $model = User::class;
protected static ?string $panel = 'owner';
protected static ?string $navigationIcon = 'heroicon-o-users';
protected static ?string $navigationGroup = 'Settings';
protected static ?string $navigationLabel = 'Users';
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery();
}
public static function shouldRegisterNavigation(): bool
{
return true;
}
public static function canViewNavigation(): bool
{
return true;
}
public static function table(Table $table): Table
{
return $table
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}
public static function getPages(): array
{
return [
'index' => Pages\ListUsers::route('/'),
'create' => Pages\CreateUser::route('/create'),
'edit' => Pages\EditUser::route('/{record}/edit'),
];
}
}
Note: i have removed the unnecessary code due to the text limit.
