#FreePalestine 🇵🇸
Need to count the unique column values in an Eloquent model effortlessly? Here's a handy way to do that.
Note that you'll need to place this on a base model that your other models would extend.
Need to count the unique column values in an Eloquent model effortlessly? Here's a handy way to do that.
Note that you'll need to place this on a base model that your other models would extend.
Use Arr::get() or “data_get” helper methods to retrieve a value from a deeply nested array using the handy "dot" notation. The “data_get” method supports objects, too!
They accept a default value as well, which will be returned if the specified key doesn't exist.
Use Arr::get() or “data_get” helper methods to retrieve a value from a deeply nested array using the handy "dot" notation. The “data_get” method supports objects, too!
They accept a default value as well, which will be returned if the specified key doesn't exist.
brew install quicklook-json --cask
And voilà — Quick Look now shows JSON files like a pro! 😎
brew install quicklook-json --cask
And voilà — Quick Look now shows JSON files like a pro! 😎
Need to update a lot of models based on some complex conditions?
Combine these Eloquent methods for a 10-100X speed bump:
• select() → retrieve only IDs
• chunkById() → use batching to break large data
• toQuery() → perform update on the models
Need to update a lot of models based on some complex conditions?
Combine these Eloquent methods for a 10-100X speed bump:
• select() → retrieve only IDs
• chunkById() → use batching to break large data
• toQuery() → perform update on the models
Supercharge your debugging with toRawSql() or ddRawSql() methods on an Eloquent query builder.
These methods output the raw SQL query with all the bindings substituted with real value – a true lifesaver when you need it the most 😉
Supercharge your debugging with toRawSql() or ddRawSql() methods on an Eloquent query builder.
These methods output the raw SQL query with all the bindings substituted with real value – a true lifesaver when you need it the most 😉
If you use custom table names often, you can access an Eloquent table name using this handy little helper function!
This is very handy if you use modules and would like to prefix table names with the module name (e.g., course__lessons, website__pages, etc.)
If you use custom table names often, you can access an Eloquent table name using this handy little helper function!
This is very handy if you use modules and would like to prefix table names with the module name (e.g., course__lessons, website__pages, etc.)
I'm halfway through, must say it's refreshingly well-written, uniquely styled, and free of fluff.
A must-read for founders like myself, who dread marketing but need to up their game.
Link in comments ↓
I'm halfway through, must say it's refreshingly well-written, uniquely styled, and free of fluff.
A must-read for founders like myself, who dread marketing but need to up their game.
Link in comments ↓
✅ Very straightforward, no fluffy introduction, etc.
✅ Doesn't use any starter kit; shows the full setup process.
✅ Gradually builds a CRUD application.
Link below ↓
✅ Very straightforward, no fluffy introduction, etc.
✅ Doesn't use any starter kit; shows the full setup process.
✅ Gradually builds a CRUD application.
Link below ↓
Stop writing complex queries in your controllers!
Use dedicated Query classes to handle aggregated data across multiple models with elegance.
Benefits:
✅ Single-purpose
✅ Clearly communicates the intent
✅ Easier to test complex queries in isolation
Stop writing complex queries in your controllers!
Use dedicated Query classes to handle aggregated data across multiple models with elegance.
Benefits:
✅ Single-purpose
✅ Clearly communicates the intent
✅ Easier to test complex queries in isolation