Can't add User profile to Companys Panel #115
Replies: 3 comments 1 reply
-
You can read more about this issue here. Also, the reason why I think a separate panel for the User would be best is this. The issue is that a "User" is considered a tenant and a "Company" is considered a tenant. Mixing their data would not be ideal. Filament, as far as I know, adds the tenant ID to the url for the Company. If a User is only supposed to see "User specific/scoped" data, then a separate panel would be best practice. |
Beta Was this translation helpful? Give feedback.
-
Andrew! Thanks for your time. If I have to use a diferent panel, Is there a way to have the same navvar for all panel? Thanks! |
Beta Was this translation helpful? Give feedback.
-
/user/profile has no tenant. User can access i't own profile from everywhere. So I Added
to FilamentCompaniesServiceProvider and it worked. |
Beta Was this translation helpful? Give feedback.
-
Hi.
First of all, I want to thank you for the plugin. I've been trying to join Jetstream and Filament and this is the answer.
Now, I want to collaborate reporting this issue. Maybe It's my fault, or a bug, I don't know.
I'm trying to add the User Profile to the company Panel, and getting error.
class FilamentCompaniesServiceProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->viteTheme('resources/css/filament/company/theme.css')
->id('company')
->path('company')
->default()
->login(Login::class)
->passwordReset()
->homeUrl(static fn (): string => url(Pages\Dashboard::getUrl(panel: 'company', tenant: Auth::user()?->personalCompany())))
->plugin(
FilamentCompanies::make()
// ->userPanel('admin')
->userPanel('user')
->switchCurrentCompany()
->updateProfileInformation()
->updatePasswords()
->setPasswords()
->connectedAccounts()
->manageBrowserSessions()
->accountDeletion()
->profilePhotos()
->api()
->companies(invitations: true)
->termsAndPrivacyPolicy()
->notifications()
->modals()
->socialite(
providers: [Providers::github()],
features: [Socialite::rememberSession(), Socialite::providerAvatars()]
),
)
->registration(Register::class)
->colors([
'primary' => Color::Amber,
])
->tenant(Company::class)
->tenantProfile(CompanySettings::class)
->tenantRegistration(CreateCompany::class)
->discoverResources(in: app_path('Filament/Company/Resources'), for: 'App\Filament\Company\Resources')
->discoverPages(in: app_path('Filament/Company/Pages'), for: 'App\Filament\Company\Pages')
->pages([
Pages\Dashboard::class,
Profile::class,
])
->userMenuItems([
'profile' => MenuItem::make()
->label('Profile')
->icon('heroicon-o-user-circle')
// ->url(static fn () => route(Profile::getRouteName(panel: 'admin'))),
->url(static fn () => route(Profile::getRouteName(panel: 'company'))),
// ->url(static fn () => route(Profile::getRouteName(panel: 'company'))),
])
->authGuard('web')
->discoverWidgets(in: app_path('Filament/Company/Widgets'), for: 'App\Filament\Company\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
}
And the error is Route [filament.company.tenant.profile] not defined.
with php artisan route:list I see theres a route
company/{tenant}/profile .................................... filament.company.pages.profile › Wallo\FilamentCompanies › Profile
Beta Was this translation helpful? Give feedback.
All reactions