NexonDEV
NexonDEV
FFilament
Created by NexonDEV on 12/2/2024 in #❓┊help
Custom panel URL
When I created a new panel set path to /test/admin, the same issue occured.
4 replies
FFilament
Created by NexonDEV on 12/2/2024 in #❓┊help
Custom panel URL
Here is my panel code, almost everything is done, I only need to figure out how to make those urls work
<?php

namespace App\Providers\Filament;

use Filament\Http\Middleware\Authenticate;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Pages;
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
use Filament\Widgets;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;

use TomatoPHP\FilamentTenancy\FilamentTenancyAppPlugin;

class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('admin')
->path('{slug}/admin')
->login('{slug}/admin/login')
->colors([
'primary' => Color::Amber,
])
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
->widgets([
\App\Filament\Widgets\OrderReportWidget::class
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
\App\Http\Middleware\EnsureTenant::class,
])
->authMiddleware([
\App\Http\Middleware\EnsureTenant::class,
Authenticate::class,
])
->plugin(\TomatoPHP\FilamentSimpleTheme\FilamentSimpleThemePlugin::make())
->plugin(\TomatoPHP\FilamentSeo\FilamentSeoPlugin::make()->allowShield())
->plugin(\BezhanSalleh\FilamentShield\FilamentShieldPlugin::make())
->plugin(
\TomatoPHP\FilamentEcommerce\FilamentEcommercePlugin::make()
->useAccounts(false)
->showOrderAccount(false)
->useCoupon()
->allowOrderExport()
->allowOrderImport()
->useWidgets()
)
->plugin(\TomatoPHP\FilamentAccounts\FilamentAccountsPlugin::make()
->useImpersonate()
->impersonateRedirect('/')
)
->plugin(
\TomatoPHP\FilamentCms\FilamentCMSPlugin::make()
->useCategory()
->usePageBuilder()
->usePost()
->allowExport()
->allowImport()
)
->plugin(\Visualbuilder\EmailTemplates\EmailTemplatesPlugin::make())
->plugin(\TomatoPHP\FilamentPayments\FilamentPaymentsPlugin::make())
->plugin(\Vormkracht10\TwoFactorAuth\TwoFactorAuthPlugin::make());
//->plugin(FilamentTenancyAppPlugin::make());
//->plugin(\TomatoPHP\FilamentBlog\FilamentBlogPlugin::make());
}
}
<?php

namespace App\Providers\Filament;

use Filament\Http\Middleware\Authenticate;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Pages;
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
use Filament\Widgets;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;

use TomatoPHP\FilamentTenancy\FilamentTenancyAppPlugin;

class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('admin')
->path('{slug}/admin')
->login('{slug}/admin/login')
->colors([
'primary' => Color::Amber,
])
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
->widgets([
\App\Filament\Widgets\OrderReportWidget::class
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
\App\Http\Middleware\EnsureTenant::class,
])
->authMiddleware([
\App\Http\Middleware\EnsureTenant::class,
Authenticate::class,
])
->plugin(\TomatoPHP\FilamentSimpleTheme\FilamentSimpleThemePlugin::make())
->plugin(\TomatoPHP\FilamentSeo\FilamentSeoPlugin::make()->allowShield())
->plugin(\BezhanSalleh\FilamentShield\FilamentShieldPlugin::make())
->plugin(
\TomatoPHP\FilamentEcommerce\FilamentEcommercePlugin::make()
->useAccounts(false)
->showOrderAccount(false)
->useCoupon()
->allowOrderExport()
->allowOrderImport()
->useWidgets()
)
->plugin(\TomatoPHP\FilamentAccounts\FilamentAccountsPlugin::make()
->useImpersonate()
->impersonateRedirect('/')
)
->plugin(
\TomatoPHP\FilamentCms\FilamentCMSPlugin::make()
->useCategory()
->usePageBuilder()
->usePost()
->allowExport()
->allowImport()
)
->plugin(\Visualbuilder\EmailTemplates\EmailTemplatesPlugin::make())
->plugin(\TomatoPHP\FilamentPayments\FilamentPaymentsPlugin::make())
->plugin(\Vormkracht10\TwoFactorAuth\TwoFactorAuthPlugin::make());
//->plugin(FilamentTenancyAppPlugin::make());
//->plugin(\TomatoPHP\FilamentBlog\FilamentBlogPlugin::make());
}
}
4 replies