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:
Don't use count() if you can use exists()If you want to check if the record exists, don't use
count()
. Useexists()
.// If you want to just check if the record exists...// Don't do this:if (User::where('approved', '1')->count()) { // ...// Do this. It's a bit faster and clear to read.if (User::where('approved', '1')->exists()) { // ...It's a bit faster. According to this forum post, ~25% faster.
And it's also more clear to read: the intention of checking is more obvious, then.
-
· 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