Skip to main content

All Tutorials

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

Tutorial Free

Laravel Many-to-Many: Get Unique Values with Collections Pluck

Let me show you a chain of Collection methods to get the colors of products for the dropdown. Imagine you have an e-shop, and you want to list the products of a category, also listing all different colors of those products, for a filter dropdown/checkbox. How to do it?

Tutorial Free

Laravel: How to Show Number/List of Users Currently Online

If you want to show the number or list of users currently online on your website, there are a few ways to do it. In this tutorial, we will show you two of them: using the session database driver, and using a custom Middleware.

Tutorial Free

How to Quickly Check PHP Version: CLI, NginX, Laravel

Sometimes you may see PHP version errors like "Your Composer dependencies require a PHP version" when running a Terminal command. Or get syntax errors like "unexpected '|', expecting variable (T_VARIABLE)" when you visit your site on the browser. One common issue between these two problems is the different PHP versions in the Terminal and on the website.

Tutorial Free

Laravel HasMany: Restrict Parent Delete to Avoid QueryException

If you have a `hasMany` relationship and want to restrict/prevent deleting the parent record if it has at least one child record, this tutorial will show you two ways: check if children exist or try-catch if Exception happens.

Tutorial Free

Livewire or Inertia? Let's Hear What Taylor Otwell Says

During the recent Laracon US event, Laravel creator Taylor Otwell announced many new things and summarized the Laravel ecosystem in 2023. Part of that was discussing the full-stack and front-end development tools. So here's what he had to say about Inertia VS Livewire.

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.