How to Change Redirect After Login/Register in Laravel Breeze
In default Laravel, there's one constant responsible for the redirection of logged-in users. How is it used in Breeze?
In-depth Laravel tutorials covering advanced topics, real-world examples, and best practices.
In default Laravel, there's one constant responsible for the redirection of logged-in users. How is it used in Breeze?
To deploy assets with Vite to the live server, one of the ways is to build them locally and then push the built assets to the repository.
The default naming convention of Laravel many-to-many pivot table is xxxxx_yyyyy, where "xxxxx" and "yyyyy" are names of related tables, in singular form, in alphabetical order.
In Laravel's many-to-many polymorphic relations, there is a situation where you can't get ALL records of different models by their "parent" record. Let me explain, and show the potential solution.
When using a relationship, have you ever seen an error like "Attempt to read property on null"? It usually means that the related record is NULL or soft-deleted. There are multiple ways to gracefully handle such a situation, without showing the error to the user.
What if your customer is filling in the order form, and meanwhile the product price has changed? Or, some product becomes out of stock? We need to re-validate the quantities/prices after the submit, right? In this article, I will show you two ways: regular Laravel and more UX-friendly "live validation" with Livewire.
This is a typical error I see developers making: using `$date->addDays(1)` and then another `$date->addYears(1)` in the same request and getting wrong results. Let me explain.
If you use Route Model Binding in your API Controllers and the record is not found, it will automatically return the 404 status code with an error message like "No query results for model [App\\Models\\User] 1". How can you override it?
When counting the Model records grouped by their type in a relationship, it's tempting to load too many DB queries or too much data into the memory. There are a few ways to optimize it, let's take a look at an example.
If you have Observer events on updated/deleted rows, it's important to know that they are fired only when you update individual rows, and not when doing mass-update or mass-delete.