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

Laravel Livewire 3: Reset Pagination after search

When you view a resultpage 2 from a paginated livewire result and change the filter or search, the generated result stays on resultpage 2. This is usually not desired. To change this behaviour and reset the Resultpage to page 1 for every new search, you can add this function to your your Livewire model: public […]

Read More… from Laravel Livewire 3: Reset Pagination after search

PDFs from spatie/laravel-pdf have no CSS when vite is not running

I create PDFs with spatie/laravel-pdf on Laravel 11, styled with TailwindCSS. My layout has I was working locally with vite running. PDfs were looking great. My deployment includes building the css with The website renders just fine with the built stylesheets from /build/assets/…. But: When I deployed my app to my forge server, the PDFs […]

Read More… from PDFs from spatie/laravel-pdf have no CSS when vite is not running

spatie/laravel-google-fonts on local environment with e.g. laragon shows “blocked: mixed content” when served over HTTPS

Problem: You use the famous https://github.com/spatie/laravel-google-fonts/, but on local development or laragon you get “blocked: mixed content”, when you call your app with HTTPS. Solution: […]

Read More… from spatie/laravel-google-fonts on local environment with e.g. laragon shows “blocked: mixed content” when served over HTTPS

Obtaining a Let’s Encrypt SSL Certificate fails on a freshly installed forge server with:”ERROR: Challenge is invalid!”

I tried to create a SSL certificate on a new digitalocean server administered by forge (a Laravel deployment and server administration service), but eventually failed with an error: ERROR: Challenge is invalid! (returned: invalid) (result: [“type”] “http-01” After some testing and research (I tried removing the .htaccess Basic Auth, changing the hostname, changing the webroot […]

Read More… from Obtaining a Let’s Encrypt SSL Certificate fails on a freshly installed forge server with:”ERROR: Challenge is invalid!”