Hide Navigation (top) on certain custom pages

Hello, Would it be possible to hide top navigation on certain custom pages? I want to change login process by adding one custom page after user logged in, but i want that page to be Filament Page without Navigation. I am using this solution by LaravelDaily to change the login process & want to hide the navigation on SwitchAccountPage custom filament page. Aslo, how can i check on every page / resource of candidate panel for a candidate_id cookie if the cookie is not set then it should redirect user to SwitchAccountPage. ? Thank you in advanced. πŸ™‚
class LoginResponse extends \Filament\Http\Responses\Auth\LoginResponse
{
public function toResponse($request): RedirectResponse|Redirector
{
if (Filament::getCurrentPanel()->getId() === 'admin') {
return redirect()->to(Dashboard::getUrl());
}

if (Filament::getCurrentPanel()->getId() === 'candidate') {
$thisuser = Auth::user();
$candidateCount = Candidate::where('email', $thisuser->email)->count();
if ($candidateCount > 1) {
// Redirect to custom page to select specific account
return redirect()->to(SwitchAccountPage::getUrl());
} else {
$candidate = Candidate::where('email', $thisuser->email)->first();
// Set candidate_id cookie
return redirect()->to(Dashboard::getUrl())->withCookie('candidate_id', $candidate->candidate_id);
}
}

return parent::toResponse($request);
}
}
class LoginResponse extends \Filament\Http\Responses\Auth\LoginResponse
{
public function toResponse($request): RedirectResponse|Redirector
{
if (Filament::getCurrentPanel()->getId() === 'admin') {
return redirect()->to(Dashboard::getUrl());
}

if (Filament::getCurrentPanel()->getId() === 'candidate') {
$thisuser = Auth::user();
$candidateCount = Candidate::where('email', $thisuser->email)->count();
if ($candidateCount > 1) {
// Redirect to custom page to select specific account
return redirect()->to(SwitchAccountPage::getUrl());
} else {
$candidate = Candidate::where('email', $thisuser->email)->first();
// Set candidate_id cookie
return redirect()->to(Dashboard::getUrl())->withCookie('candidate_id', $candidate->candidate_id);
}
}

return parent::toResponse($request);
}
}
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server