F
Filamentβ€’15mo ago
Ridlafalah

How to use PostResource on both panel

i create 2 panel for separate admin panel and user panel with each has a different folder path (admin and user) if i want to create a post resource where should i put the resource so i can access it on both pages, thanks.
9 Replies
LeandroFerreira
LeandroFerreiraβ€’15mo ago
You can create a folder like app/Filament/SharedResources and use discoverResources()
$panel->discoverResources(in: app_path('Filament/SharedResources'), for: 'App\\Filament\\SharedResources')
$panel->discoverResources(in: app_path('Filament/SharedResources'), for: 'App\\Filament\\SharedResources')
Ridlafalah
RidlafalahOPβ€’15mo ago
im already have a default ->discoverResources(in: app_path('Filament/Teacher/Resources'), for: 'App\\Filament\\Teacher\\Resources') can i cannot add inside that, it shown an error, Cannot use positional argument after named argument.
LeandroFerreira
LeandroFerreiraβ€’15mo ago
Did you do this?
->discoverResources(in: app_path('Filament/Teacher/Resources'), for: 'App\\Filament\\Teacher\\Resources')
->discoverResources(in: app_path('Filament/SharedResources'), for: 'App\\Filament\\SharedResources')
->discoverResources(in: app_path('Filament/Teacher/Resources'), for: 'App\\Filament\\Teacher\\Resources')
->discoverResources(in: app_path('Filament/SharedResources'), for: 'App\\Filament\\SharedResources')
Ridlafalah
RidlafalahOPβ€’15mo ago
No description
No description
No description
Ridlafalah
RidlafalahOPβ€’15mo ago
i did , those are the files and code, what did i missed?
LeandroFerreira
LeandroFerreiraβ€’15mo ago
namespace App\Filament\SharedResources; ? namespace App\Filament\SharedResources\PostResource\Pages; ?
Ridlafalah
RidlafalahOPβ€’15mo ago
just solved it, i'll modify the folder structure, shared/resources
No description
Ridlafalah
RidlafalahOPβ€’15mo ago
thanks bro, you safe my day πŸ™πŸ»
jackleblackdev
jackleblackdevβ€’12mo ago
hi , is it not possible to only modify form or table in extended ressource ?
Want results from more Discord servers?
Add your server