Skip to main content

All Tutorials

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

Tutorial Free

Interfaces in Laravel: Simple Singleton Example of Two Services

When do you need to create interfaces in PHP/Laravel? Suppose you have a method with different implementations depending on some condition. In that case, it may be a candidate for an interface, with different classes implementing that interface method differently, depending on that condition. Let me show an example.

Tutorial Free

Sort Laravel Collection by Many-to-Many Pivot Value

If you have a Laravel many-to-many relationship and need to sort the Collection by the pivot table value, the query may be complicated. Let's take a look at this example.

Tutorial Free

Post Excerpt: Slice Content in Laravel or in Vue?

Imagine you have a Laravel + Vue project with Posts in the DB but need to show only the first 300 characters of content in the Posts list. Where should you perform that slicing - in Vue or Laravel? Let's compare.

Tutorial Free

Filament: Export Record to PDF - Two Ways

Exporting data to PDF is a very common feature. This tutorial will show how to do it in the Filament admin panel: we will export a single record to PDF using Blade View and barryvdh/laravel-dompdf package.

Tutorial Free

Laravel Migrations: "Table already exists" After Foreign Key Failed

If you create foreign keys in your migrations, there may be a situation that the table is created successfully, but the foreign key fails. Then your migration is "half successful", and if you re-run it after the fix, it will say "Table already exists". What to do?

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.