Laravel Pro Tips
#eloquent #memory
π₯ #Laravel #Eloquent Advice: Your application may run out of memory if you attempt to load large group of #Eloquent records via the `all` or `get` methods. Instead, chunk method may be used to process large numbers of models more efficiently. #Laravel #Databse #PHP
Laravel Eloquent
#directives #environments
#Laravel Tip π₯: production & env directives are very handy to execute the conditional code based on your server type. #PHP #webdevelopers #100DaysOfCode #developers
Mohammad Haris β‘
#carbon #dates
π₯ Laravel tip: Use the CarbonImmutable class instead of Carbon to avoid changing the object without having to clone it.
Damian Escobedo
#arrays
New Arr::keyBy() method added in #Laravel 9.2
Teacoders
#eloquent #scopes
πΆοΈ #Laravel Tip: Favour a more declarative coding style by using Eloquent Query Scopes. Scopes make your code more meaningful and semantic π #PHP #Developers #coding
Bilal Haidar - Available 4 Laravel gigs
#commands #artisan
Laravel tip of the day: if you have an Artisan command, and you want to launch another command inside of it, suppressing any potential messages/prompts it may have, use $this->callSilent() Example from Laravel Jetstream: https://t.co/cpSacILxIk
Povilas Korop | Laravel Courses Creator & Youtuber
#events #listeners
Did you know that you can create a "Subscriber" class in Laravel to handle multiple events with different methods in one Listener class? This is very useful if you want to group certain actions with the same dependencies. Documentation: https://t.co/sktnO8qyDj
Bobby Bouwmann
#models #relationships
π₯ Quick #Laravel Tip - The belongsTo, hasOne, hasOneThrough, and morphOne relationships allow you to define a default model that will be returned if the given relationship is null. This pattern is often referred to as the Null Object pattern.
Marian Pop πΊπ¦ Laravel Magazine
#notifications
πΆοΈ #Laravel tip: Sometimes you may need to send a notification to someone who is not stored as a "user" of your application. Welcome to On-Demand Notifications in Laravel π₯ #PHP #Developers