🔥 Want to return a different response depending on the request's `Accept` header?
Have a macro! 🍰
Been playing with Laravel's new Responsable contract to return multiple formats, including CSS for a user's custom branding colors: https://t.co/Y9GSBsr0dr
🔥 Dedicated view objects are a great use case for Laravel 5.5's new `Responsable` interface.
Can remove the need for other fancy patterns 👍 https://t.co/qFpK6SRHLC
🤠 Anything you can pass to phpunit, you can pass into the "artisan dusk" command. https://t.co/YMjGv21Pmu
🔥 PHP's DateTime class (and Carbon) can parse certain human phrases.
Nice for using relative dates to avoid hard-coding in tests 👍🏻 https://t.co/VTXtCp5DDf
Quick Tip. 🤗🔥
Calling just the filter method on a collection will remove all falsy values from the collection. #laravel #laravelTips https://t.co/CWxzElNGch
Little Laravel Testing Tip 👌
It works for all HTTP Verbs. (GET, POST, PATCH, DELETE)
#laravel #phpunit #testing https://t.co/bCbfO1ZYFz
The QueryBuilder for @laravelphp also has an orWhereIn method. Works just like whereIn, but sends 'or' as 3rd param instead of 'and'. Clean! https://t.co/y9ohYrtjQ5
Constantly blown away by the simplicity of @laravelphp. Need to return paginated links from your API while retaining the GET variables? Np.🚬 https://t.co/5bgShFhODo
How many times have you used a conditional to append an 's' to a word and pluralize it? `str_plural` to the rescue 👍 #Laravel https://t.co/C5OciflOSR
Want to make sure that your Laravel routing won't interfere too much with Vue? With the following method you can easily combine both! #VueJS https://t.co/kebeCdXbIm
TIL with @laravelphp, relationship can have where clause. This enabled me to make one "event" model for multiple other models. Nice! 🔥 https://t.co/vbRLAluzhv
🤠 Tinker Tip: the "doc" command is bomb-diggity. Saves me so many trips to https://t.co/3dBJVjUM6C... https://t.co/lh0SHky9Uq https://t.co/IqkdFzpvYl
Just learned array_filter has a dual purpose! 😍 It eliminates falsy values if no callback is supplied. Works with collections as well 🤠 https://t.co/3bouj1KMBn
collections are neat. 3 lines of code to get the % of reviews in each bin a la Amazon. beats a foreach loop w/ empty array! Thx @adamwathan https://t.co/kA17QJgdCw
Laravel intersect() sadly filters the data using array_filter, so I made a little helper to use instead. https://t.co/l9gCxg7pzD
(validation.php FTW) I'm notorious for leaving "This [model] id is required" - this ends today! ✊ https://t.co/WiZSGOCXb0
Did you know you can “inherit”, and customize, a relationship from a related model in @laravelphp?
Thanks to @adamwathan for MySQL help :) https://t.co/nRBZ4i1pxP
@calebporzio @DCoulbourne Listened to the latest episode! Rather than using a me() helper, I pass a $me variable with a view composer. 😬 https://t.co/1vea381FCH
You can now use the @auth blade directive in @laravelphp.
#laravel #php https://t.co/5cldFzrxBf