TIP: You want to export #laravel eloquent query to native mysql? Here's a quick way to do it: https://t.co/ORGfKtEHNY - Gives out everything you need to run it in mysql console
* Warning, doesn't go friendly with relationships and so on. Works on single queries
🔥 In many cases avoiding `else` and using early returns will greatly improve readability of your code.
I wish somebody would have told me this sooner in my career.
Contrived example in the image. Real world example: https://t.co/oOsSGAJLZm
Came across a quick way to fake a single requirement so Composer can install a dependency instead of using the heavy handed `--ignore-platform-reqs`. https://t.co/LYsHRmTJon
🌟 Here is another great #Tip for Composer:
If you don't want to scroll through all the installation conflicts when doing a `composer update`, did you know you can ask composer why a specific package can not be installed?
Just use `composer why-not <package> <version>`? https://t.co/RCZs4x34eu
Too impatient to wait for third-party packages to update their requirements?
Use with care (and good test coverage!) 😅 https://t.co/rRdiPiPp3F
🔥Want to have a test route but don't want to worry about taking it out for production/ exposing it by mistake?
Use this to make it only available on local. ✊
#php #laravel #100DaysOfCode
#Laravel tip of the day: you can do *recursive* Laravel relationships in Eloquent, see screenshot and read more in this article: https://t.co/4UgBf52WLQ https://t.co/aWMapCIwWg
#Laravel tip of the day: Laravel Collection has nice firstWhere() method to make your code a little shorter. See example in the screenshot and the docs: https://t.co/vpKM0BMZCt https://t.co/K4sdYsg9zA
🔥 When working with logic to determine exception throwing, consider extracting it to a separate method. This allows for less cognitive overload inside the method you're scanning through and for re-usability.
💡 More dev tips: https://t.co/LhsCAz563J
#PHP #DevTips https://t.co/Y7zowSh6Xl
@driesvints The pattern is often called the Guard Pattern and most of the time it's common to call the method "guardAgainst..." so for example: https://t.co/34mMVzIIxC
Did you know you may also pass `null` as a function typed parameter value in #PHP, even though the type is not marked nullable with `?`
All parameters with a default value of `null` may receive `null` as a value. https://t.co/mdbqXprZag
??? #TIL You can use the "--testdox" flag in PHPUnit to get a list of the methods (test) in the CLI output
@laravelphp #PHP #PHPUnit https://t.co/QQjV7bHRh6
Multi inserts in db with PHP #phptip https://t.co/JN3OttCN5u
Do yourself a favor and work to make your code more readable. Even simple conditional checks could take a few seconds to understand 6 months from now ? #php #laravel #clean #code https://t.co/yxrqvs1wgV
? If you're application is behind a proxy/load balancer, you can force HTTPS at the web server level by checking the X-Forwarded-Proto header https://t.co/oomJNOWNUe
Don't be afraid to be explicit with config / embed values. Your colleagues and future self will thank you. https://t.co/0cc03AGdzA
Remind that you can dump your test response, if you need to take a quick glance at its content. #Laravel https://t.co/r2euoqlSzl
Ever want to reset a piece of your Vue component state back to it's initial values?
Using this until someone tells me otherwise! https://t.co/HUapG5pA9u
If you're using #php and want to find the closest date to today in an array of dates, check out this quick snippet! https://t.co/b7zUWyzaY6
For those who like me din't know about this PhpUnit feature: you can run failed tests first ? - https://t.co/6cABml1jp5