Latest Premium Tutorial
-
· 13 mins, 2585 words · premium
Eloquent Performance: Enum VS Int/Tinyint and SoftDeletes
I recently worked with an Eloquent query with the `where status = 'new'` filter by ENUM value, which felt quite slow. I changed it to `status_id` instead. Was it faster? Let's find out together.
Newest content
-
· 4 mins, 767 words
Laravel SaaS: 9 Useful Packages and Tools
-
· 4 mins, 681 words
10 Large Open-Source Projects Built with Laravel
-
Random Quick Laravel Tip:
Merging eloquent collectionsThe Eloquent collection's merge method uses the
id
to avoid duplicated models.But if you are merging collections of different Models, it can get you unexpected results.
Use the base collection method instead.
$videos = Video::all();$images = Image::all();// If there are videos with the same id as images they will get replaced// You'll end up with missing videos$allMedia = $videos->merge($images);// call `toBase()` in your eloquent collection to use the base merge method instead$allMedia = $videos->toBase()->merge($images);Tip given by @cosmeescobedo
-
· 3 mins, 428 words
Generate Random Strings with Laravel: Helper Methods
-
· 2 mins, 253 words
Filament Relation Manager: Hide on View/Edit Page?
-
· 1 min, 190 words
Filament Table Null Value: formatStateUsing() Doesn't Work?
-
Premium Course: Vue Inertia + Laravel 11: From Scratch
-
· 5 mins, 962 words
MongoDB in Laravel: Short Guide for Beginners
-
· 2 mins, 227 words
Filament Placeholder vs Hint: When to Use Which?
-
· 4 mins, 679 words
Filament: Get URLs and Route Names for Resources/Pages
-
· 2 mins, 227 words
Filament Select: Use HTML with CSS in Options
-
· 17 mins, 3274 words · premium
17+ Laravel "Bad Practices" You Should Avoid