Skip to main content

All Tutorials

In-depth Laravel tutorials covering advanced topics, real-world examples, and best practices.

Tutorial Free

How to name a pivot table in many-to-many in Laravel

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.

Tutorial Premium

Laravel Validation: Stock/Price Change with or without Livewire

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.

Tutorial Free

Laravel API: Override 404 Error Message in Route Model Binding

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?

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.