Laravel 12: A Middleware to enable Fortify to work with multiple guards

Laravel Fortify can only work with the web guard. Some things work, when more than 1 guard is configured, but GET /settings/password-confirm and some more routes do not. Here is a middleware approach that authenticates the user against multiple guards. Change files accordingly. app/Providers/FortifyServiceProvider.php Add a function configurePasswordConfirmation() to the boot() method, that validates the […]

Read More… from Laravel 12: A Middleware to enable Fortify to work with multiple guards

Laravel 11 Form validation rules with custom logic in Request with ErrorBag

For a project we need a form for saving subscribers. You should be able to input 4 values: subscribers_f, subscribers_m, subscribers_d, and the sum of all subscribers. You can also select a category from a dropdown. For categories 2 and 3 you need to check that the actual sum (f+m+d) matches the “sum” input field. […]

Read More… from Laravel 11 Form validation rules with custom logic in Request with ErrorBag