Sir. NioH
Sir. NioH
FFilament
Created by Sir. NioH on 10/1/2024 in #❓┊help
Bulk Actions Directly in Dashboard Widgets
No description
5 replies
FFilament
Created by Sir. NioH on 9/27/2024 in #❓┊help
Multiple 'violating node' warnings in browser console after deploying to production
No description
2 replies
FFilament
Created by Sir. NioH on 8/27/2024 in #❓┊help
Issues with Email Verification Redirect in Filament/Laravel Setup
Hi everyone, I'm facing an issue in my Filament + Laravel project related to email verification. After verifying an email, the user is redirected to the login page instead of the intended success page. I've tried several approaches, including Laravel's default verification, a custom VerificationController, and Filament's built-in methods, but nothing has worked. Key Details: Custom Controller: Handles verification but fails to redirect correctly. Filament Setup: Tried reverting to Filament's ->emailVerification() method, no change. Simplified Routes: Used basic Laravel routes, issue persists. Problem: Users are redirected to the login page instead of the success page (/verification-success) after verifying their email. Code Fragments: VerificationController:
<?php
public function verify(Request $request, $id, $hash)
{
$user = Auth::user();
if ($id != $user->getKey() || !hash_equals($hash, sha1($user->getEmailForVerification()))) {
return Redirect::route('login')->with('error', 'Invalid verification link.');
}
if ($user->markEmailAsVerified()) {
event(new Verified($user));
}
return redirect($this->redirectTo)->with('success', 'Your email has been verified successfully.');
}
<?php
public function verify(Request $request, $id, $hash)
{
$user = Auth::user();
if ($id != $user->getKey() || !hash_equals($hash, sha1($user->getEmailForVerification()))) {
return Redirect::route('login')->with('error', 'Invalid verification link.');
}
if ($user->markEmailAsVerified()) {
event(new Verified($user));
}
return redirect($this->redirectTo)->with('success', 'Your email has been verified successfully.');
}
Email Verification Class:
class EmailVerification extends EmailVerificationPrompt
{
public function mount(): void
{
if ($this->getVerifiable()->hasVerifiedEmail()) {
redirect()->route('custom.verification.success')->send();
}
}

public function fulfillVerification(EmailVerificationRequest $request)
{
$request->fulfill();
return redirect()->route('custom.verification.success');
}
}
class EmailVerification extends EmailVerificationPrompt
{
public function mount(): void
{
if ($this->getVerifiable()->hasVerifiedEmail()) {
redirect()->route('custom.verification.success')->send();
}
}

public function fulfillVerification(EmailVerificationRequest $request)
{
$request->fulfill();
return redirect()->route('custom.verification.success');
}
}
Has anyone experienced something similar? Any suggestions would be greatly appreciated! Thanks!
33 replies
FFilament
Created by Sir. NioH on 5/15/2024 in #❓┊help
the contents of the table are not visible
No description
12 replies