Skip to main content

All Tutorials

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

Tutorial Free

Laravel Eloquent: Repeating Relationships Reusable in Traits

If multiple Eloquent models in your project have the same identical relationship methods, like `createdBy()`, for example, you may extract them in a reusable structure. We will show you an example with Traits.

Tutorial Free

Filament 3: Login with Name, Username or Email

By default, the Filament login form contains email and password fields. In this short tutorial, let's see how to log in to the panel using `name` or `email` in the same field. Instead of `name`, you can have `username`, the logic would be similar.

Tutorial Free

This Week in Filament #1: August 10, 2023

I'm starting a new weekly tradition: every Wednesday/Thursday, I will publish an article with all the news about Filament from previous week.

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.