a5sys/logged-in-redirection-bundle
symfony/security-bundle) could enable integration. Key question: Is the Laravel app using Symfony components, or would this require a custom wrapper?KernelEvents::REQUEST) to intercept login page requests. Laravel’s middleware could replicate this behavior without tight coupling.spatie/laravel-symfony-support). Otherwise, medium—would require rewriting the logic in Laravel middleware.fos_user_security_login → homepage), which aligns with Laravel’s route naming conventions.GET vs. ANY requests) may need validation.isGranted('IS_AUTHENTICATED_FULLY')) won’t work natively.
Auth::check().?next=) should be tested.security-bundle? If not, what’s the cost of a custom middleware vs. the bundle?fos_user_security_login, homepage) consistent with Laravel’s naming (e.g., login, dashboard)?auth:verify) + route middleware achieve this without external dependencies?spatie/laravel-symfony-support), integration is straightforward:
AppKernel (Symfony) or a custom service provider (Laravel).config.yml (or Laravel’s config/logged_in_redirection.php).// app/Http/Middleware/RedirectIfLoggedIn.php
public function handle($request, Closure $next) {
if (Auth::check() && $request->routeIs('login')) {
return redirect()->route('dashboard');
}
return $next($request);
}
app/Http/Kernel.php before Authenticate middleware.auth:verify)./login?next=/profile.symfony/security-bundle.illuminate/auth (built-in).AppKernel, configure config.yml.Kernel.php.config.yml), minimal code changes.debug:event-dispatcher to inspect bundle hooks.dd() or Log::debug() in middleware for request/response inspection.redirect_route_name doesn’t loop back to the login page.unless middleware flags.| Scenario | Impact | Mitigation |
|---|---|---|
| Bundle not triggered | Users stuck on login page | Fallback to middleware or route guards. |
| Infinite redirect loop | 500 errors or degraded UX | Add unless conditions in middleware. |
| Symfony deprecation | Bundle breaks on upgrade | Fork or migrate to middleware. |
| Route name mismatch | Redirection fails silently | Validate routes in CI/CD. |
config.yml changes and event hooks.?next= parameters).How can I help you explore Laravel packages today?