Laravel redirect on a missing model resource instead of 404
When a model resource is not found in Laravel you get an HTTP 404 not found, however you can also do other actions such as a redirect. Using the missing()…
When a model resource is not found in Laravel you get an HTTP 404 not found, however you can also do other actions such as a redirect. Using the missing()…
Changing the redirect location for when users login in Laravel. You can find this value at the below location app/providers/RouteServiceProvider.php Edit the HOME const to where you want the authenticated…
How to easily bypass or exclude a global scope on a Laravel model. Remove a registered global scope by using withoutGlobalScope() in your eloquent query with the parameter being the…
Generating and then downloading PDF files using Laravel, essentially you are downloading blade files as PDF’s which can open up your web applications to some unique possibilities. This post was…
Shortcut helper functions when using the Laravel HTTP client to validate HTTP responses. Instead of manually checking an HTTP response status code, you can use the Laravel HTTP client helpers….
How to easily change the value of a request parameter in Laravel. You can do this by using the merge method to merge an array or collection with the original….
If you ever needed a simple solution in Laravel to delete an entire directory and its contents the File facade has the answer. deleteDirectory() will delete everything, both files and…
How to enforce only one user to register or be registered in a Laravel web application is very simple to implement. Find your registered user controller most likely at App\Http\Controllers\Auth\RegisteredUserController.php…
How to make your Inertia and React JS Laravel app utilize server-side rendering and why you should use SSR for your web pages. What is SSR? SSR is server-side rendering…
Using The Laravel Eloquent query builder to fetch and filter records based on their date and time. Here are examples for when you need to retrieve records that are older…