Laravel Pro Tips
#arrays
#Laravel Tip 🔥 : You can set the prefix in array keys with newly released method prependKeysWith() in Laravel 9.14.0 Let's checkout an example 👇: #PHP #webdevelopers #100DaysOfCode #developers
Mohammad Haris ⚡
Shoutout to my favorite array helper in Laravel 🔀 Arr::random returns one or multiple random values from an array. Unlike the native array_rand which return a random key.
Daniel Eckermann
#arrays #fluent
🌶️ #Laravel Tip: Come and learn about 𝙁𝙡𝙪𝙚𝙣𝙩, a hidden gem in Laravel! You use a Fluent class to wrap over an Array. Fluent offers: ✅ Safe access to elements ✅ Array-Like or stdClass-Like access #PHP #Developers
Bilal Haidar - Available 4 Laravel gigs
New Arr::keyBy() method added in #Laravel 9.2
Teacoders
#validation #arrays
Yesterday, a really useful PR got merged into Laravel! It adds a "required_array_keys" validation rule. The rule checks that all of the specified keys exist in an array. I can already think of a few places in my projects where I could use this myself 🚀 #laravel #php
Ash Allen 🚀
Array destructuring is probably one of my favorite things in modern PHP and I don't think I use it enough
Andrew Schmelyun
Apr 6th, 2022
Validating arrays and nested values in Laravel
Validating arrays and nested values allows you to more effectively deal with data transmitted from your frontend.