Laravel Shots
@LaravelShots
Laravel tips packed in a simple tweet. Sending 3 high-quality laravel tips and resources to your inbox every month. By @introwit
You might like
Really digging Laravel's `firstOr()` method! laravel.com/docs/8.x/eloqu…
A @Laravelphp tip from Kirschbaum senior developer Rob Fonseca @therobfonz If you need to ensure a Artisan command runs after another one completes, use the then() method. #laravel #webapplicationdevelopment
🤤Remove those conditionals around code responsible to dispatch jobs and let @laravelphp make it cleaner for you!
So beautiful! 🤤
In @laravelphp, the "partition()" method may be combined with the array destructuring PHP feature to separate elements that pass a given truth test from those that do not. 🖖🏻
😧 Woah! 🏃♂️ _runs to refactor the test suite_ 🏃♂️
🔥 One of my favourite testing helpers is a `login` method on the base `TestCase` class. Perfect for quickly creating a `User` and logging them in, as well as customising the `UserFactory` via a callback function. gist.github.com/ryangjchandler…
💥 Bookmark this one 👇
This is a bunch of options that you can use to make your code shorter, cleaner, and readable. by using the framework's powerful features you can always do the same behaviors with shorter code. #laravel 💡💡
Handy 🤩
Sometimes I just need a quick password hash: `php artisan tinker --execute="echo bcrypt('password')" | pbcopy`
🔥 Gotta love #PHP 8.0’s null safe operator! Demo: spatie.be/videos/front-l… You can use it instead of @laravelphp’s handy `optional` helper.
Now dispatch jobs from your db transactions without worrying 🔥
🤓 TIL about the "ping" attribute on <a> tags, which will send a POST request to the given URLs when the anchor is clicked. 🔗 developer.mozilla.org/en-US/docs/Web…
🧪 PhpStorm Tips & Tricks #27 - Toggle Search Scope I hope you already know your shortcuts for specific searches. ( files, classes, etc.) One little trick here is if you press the shortcut again it toggles the scope of the search between "Project Files" and "All Files" 🔍
Wait what 🤯🤑
🔥 You may know that you can query against JSON columns using the `column->key` syntax in @laravelphp, but I just learned you can use the same syntax in your tests when asserting that the database has certain data!
🔥🔥🔥
TIL 😍
Did you know that you can use array_filter oder collect()->filter() without any arguments to remove empty values? A nice way to quickly get rid of optional data in API requests payloads.
So cool @lizziepika⚡️Supercharge your zsh workflow ⚡️
🤯 I just learnt about the "take" command and "Ctrl+Q" for parking a command. twilio.com/blog/zsh-trick…
Neat 🧼
Adding a simple `redirectMap` macro to the @laravelphp router can help you clean up your routes file if you have lots of redirects.
PSA: Laravel <= 8.4.2 has vulnerability (CVE-2021-3129) allowing someone to put a crypto miner on your server if you have DEBUG mode on. reddit.com/r/laravel/comm…
You need to constantly check if a user is an admin on your Laravel views? Create an "admin" directive and save some extra lines of code every time:
🔥 TIL (or re-learned) that the `pluck` method on a @laravelphp collection accepts a second parameter to specify how you'd like the collection keyed. Super handy in certain cases!
United States Trends
- 1. Penn State 23.2K posts
- 2. Indiana 38.7K posts
- 3. Mendoza 20.2K posts
- 4. Gus Johnson 6,764 posts
- 5. #UFCVegas111 5,107 posts
- 6. #iufb 4,197 posts
- 7. Sayin 69.2K posts
- 8. Omar Cooper 9,572 posts
- 9. Iowa 19.5K posts
- 10. Estevao 39.1K posts
- 11. Josh Hokit N/A
- 12. Sunderland 155K posts
- 13. Mizzou 3,730 posts
- 14. Kirby Moore N/A
- 15. Texas Tech 13.9K posts
- 16. Jim Knowles N/A
- 17. Happy Valley 1,908 posts
- 18. James Franklin 8,851 posts
- 19. Carter Smith N/A
- 20. Oregon 33.7K posts
You might like
-
Laravel News Links
@LaravelLinks -
MadeWithLaravel
@MadeWithLaravel -
Livewire
@LaravelLivewire -
The Laravel Podcast
@LaravelPodcast -
Laravel Idea
@laravel_idea -
Larajobs
@laraveljobs -
Laravel.io
@laravelio -
Spatie
@spatie_be -
Povilas Korop | Laravel Courses Creator & Youtuber
@PovilasKorop -
Certification for Laravel
@LaravelCert -
Bobby Bouwmann
@bobbybouwmann -
Laracon EU
@LaraconEU -
Barry vd. Heuvel
@barryvdh -
Shift
@laravelshift -
Inertia.js
@inertiajs
Something went wrong.
Something went wrong.