Introducing Scout Extended
Last month at the Laravel PHP Paris meetup, Nuno Maduro introduced his newest package called Scout Extended.
Last month at the Laravel PHP Paris meetup, Nuno Maduro introduced his newest package called Scout Extended.
Jonathan Reininck wrote a cool article on how you can create dynamic releationships. This technique will keep the number of queries and the memory used to a minimum.
I hope that gives you a good overview of how you can use subqueries to create dynamic relationships in Laravel. This is a powerful technique that allows you to push more work into the database layer of your app. This can have a huge impact on performance by allowing you to drastically reduce the number of database queries executed and overall memory used.
Read more [reinink.ca]
Join 9,500+ smart developers
Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
"As a Laravel developer, this is the one newsletter I most look forward to. Freek has a talent for distilling packages or techniques down to something immediately useful - one tip can save you hours and even weeks. It's concise and practical and highly relevant."
Did you know that you can define a $dispatchesEvents property on your Eloquent model and map native Eloquent events to your own event classes? ? Check this out: pic.twitter.com/P205GTIYEc
— Laravel Docs Daily (@laradocsdaily) November 24, 2018
Read more [twitter.com]
Here's a video of Surma having technical problems while presenting his State of Houdini talk. Luckily Jake Archibald and others "help" him out ? No matter how well you prepare a talk, you can always have technical difficulties. If you handle the failure gracefully, the public won't mind.…
This year Laracon AU was held for the very first time. According to what I read on Twitter Michael Dyrynda did an awesome job organising it.
The organisation was so kind to record all talks. They are now available on YouTube. You'll find all talks in this playlist.
Below you can see the talk titled "Abusing Laravel for Fun and Profit" by David Hemphill
At Spatie we have a tv screen against the wall that displays a dashboard. This dashboard displays the tasks our team should be working on, important events in the near future, which tasks each of our team members should be working on, what music they are listening to, and so on. Here's what it looks…
Let's take a look at how you can define routes to controllers in Laravel. By default you can do it like this: Route::get('my-route', 'MyController@index'); This will look for the MyController class in the App\Http\Controllers namespace. This default namespace is set up in Laravel's…
There are three ways of loading relationships in Laravel. Tim MacDonald, a freelance dev based in Sydney, explains them all.
It is often useful to show the number of related models a given instance has, but not actually need any specific information about the related models, just how many exist. In this scenario you do not want to load all of the related models into memory to count them, we want our database to do the heavy lifting for us. Laravel offers a number of ways to retrieve relationship counts.
Read more [timacdonald.me]
Some solid advice from Adel Faiz: do not use a package for authorization unless you really need its functionalities. Laravel's default authorization capabilities are good enough for most use cases.
I don't want to say these packages are useless. They can be useful for projects which needs complicated authorization system, which should be customizable by customer later. Also some projects need dynamic permissions. For all other projects it's too heavy solution. Better to use simple code-based authorization.
Read more [adelf.pro]
Oh Dear!, the monitoring service that my buddy Mattias and I run, now has the ability to auto import sites from Forge.
Forge recently introduced a feature called tags, whichs allows you to add custom tags to any server or site in Forge. We use those tags to determine which sites we should automatically add to your Oh Dear! Account. Every site or server tagged with oh-dear will be added. This allows you to still pick which sites should - or should not - get monitored.
Read more [ohdear.app]
Laravel Nova is cool package to quickly create admin interfaces in a Laravel app. Unfortunately there's no support for multiple locales out of the box. A while ago we published a package called nova-translatable that makes any of the built in field types translatable. Using the package In order to…
Mattias explains a problem we recently encountered at Oh Dear with Telescope.
For Oh Dear!, we're using Laravel Telescope as a convenient way of tracking/displaying exceptions, runs, ... It stores its exceptions in the database, so you can easily view them again. It stores those in a TEXT field in MySQL, which is limited to 2^16 bytes, or 65536 bytes. Some of our exceptions tend to be pretty long, and they were hitting this limit.
Read more [ma.ttias.be]
✨ Laravel users, make this small change to your app.js file to auto register your Vue components. The filename becomes the component name. ?
— Jonathan Reinink (@reinink) 2 november 2018
Gist here: https://t.co/Y3NjLzgBEI pic.twitter.com/h5ByVNuiR6
Read more [twitter.com]
My buddy Mattias and I run a monitoring service called Oh Dear! We plan on regularly writing cool stuff on the technical and commericial challenges we face. Here's the first post on how we scale our queues.
Laravel offers a convenient way to create asynchronous background tasks using its queues. We utilize those heavily at Oh Dear! for all our monitoring jobs and in this post we'll share some of our lessons learned and what we consider to be best practices.
Read more [ohdear.app]
?⚾️ Just found out throw_unless returns the provided condition! This took an already super handy helper and made it ? pic.twitter.com/aaz3Oc7uye
— Caleb Porzio (@calebporzio) October 26, 2018
Read more [twitter.com]
At Spatie we do a lot of open source work. You can find a list of our packages on the open source section of our website. I'm proud to share that, according to Packagist, the Spatie packages have now been downloaded over 20 million times. The rate at which they are being downloaded is growing too.…
? The "pluck" method in Laravel's collections can take a string with dots to get a list of deeply nested values. You can also add a star to combine deeply nested lists ?https://t.co/qckA0dLw45 pic.twitter.com/3im6dGYoTi
— Joseph Silber (@joseph_silber) October 25, 2018
Read more [twitter.com]
While working on a package I found myself trying to combine some data. This is what my code looked like. Assume that $locales and $fields are arrays that are already populated. collect($locales)->each(function (string $locale) { collect($fields)->each(function (Field $field) use ($locale)…
Last week Adam Wathan's excellent Laracon US talk was published. Highly recommened to check it out even if you don't use Laravel.
At the LaraconLive India conference, Shawn McCool shared some interesting ideas on how to handle models in complex apps.
If you want to speak at the 2019 edition of the conference, you'll be happy to learn that they currently have a CFP running.