create route outside of tenant

Hi guys, I'm creating a Saas app using FIlament php and I love it, but one thing, I need to create a page outside of tenant with simple layout, like Login or Profile page, but couldn't get the route to register properly. When i change the Page class to SimplePage, i am getting 404 error and route is missing from route:list. Any ideas? By the way the Page is not under any resource.
1 Reply
n0nsensei95
n0nsensei95OP13mo ago
class SubscribePage extends SimplePage
{
use InteractsWithFormActions;
use HasRoutes;

protected static ?string $navigationIcon = 'heroicon-o-document-text';

protected static string $view = 'filament.app.pages.subscribe-page';

public static function getSlug(): string
{
return static::$slug ?? 'subscribe-page';
}

public static function routes(Panel $panel): void
{
$slug = static::getSlug();

Route::get("/{$slug}", static::class)
->middleware(static::getRouteMiddleware($panel))
->withoutMiddleware(static::getWithoutRouteMiddleware($panel))
->name('subscribe-page');
}


public static function getRouteMiddleware(Panel $panel): string|array
{
return [
...(static::isEmailVerificationRequired($panel) ? [static::getEmailVerifiedMiddleware($panel)] : []),
...Arr::wrap(static::$routeMiddleware),
];
}

}
class SubscribePage extends SimplePage
{
use InteractsWithFormActions;
use HasRoutes;

protected static ?string $navigationIcon = 'heroicon-o-document-text';

protected static string $view = 'filament.app.pages.subscribe-page';

public static function getSlug(): string
{
return static::$slug ?? 'subscribe-page';
}

public static function routes(Panel $panel): void
{
$slug = static::getSlug();

Route::get("/{$slug}", static::class)
->middleware(static::getRouteMiddleware($panel))
->withoutMiddleware(static::getWithoutRouteMiddleware($panel))
->name('subscribe-page');
}


public static function getRouteMiddleware(Panel $panel): string|array
{
return [
...(static::isEmailVerificationRequired($panel) ? [static::getEmailVerifiedMiddleware($panel)] : []),
...Arr::wrap(static::$routeMiddleware),
];
}

}
This is my page class
Want results from more Discord servers?
Add your server