Laravel Community Tools by Tighten

Category "Views" tricks

71 tricks
I originally published this trick on Medium: https://medium.com/@simondepelchin/how-to-use-font-awesome-5-svgs-with-laravel-blade-a5dc93743cd0
webartisan 8 years ago 5285
What if you want to use the @push blade directive but you don't want it to push twice the same content? For example, if you have a UI component that loads JS files and you want to reuse that component in the same view, so without this trick it will load twice your JS code from your different UI components.
laraning 8 years ago 7560
If you have a @yield directive, you know that you can pass a default content in the 2nd argument. What if you want to pass the content of a view?
laraning 8 years ago 3968
If you have a dynamically generated list from DB, like [1 => 'First option', 2 => 'Second option', ...] use the following Collection magic to build a full select list with 'Please choose..' option at the beginning and 'Other..' option at the end.
subdesign 8 years ago 4524
This helper will helps you to serve the assets which is last updated by the server. The Main aim of this helper to eliminate the cache of the assets we updated in server.
decipher 8 years ago 5265
This helper lets you easily add classes to active navigation elements using {{ chkNav('posts', 'active') }}
alexmayo 8 years ago 3950
Laravel Invisible reCAPTCHA Example – Laravel Validate Form on Submit using Google reCaptcha
dave 8 years ago 8400
View composers are nice but they have some problems accocsiated with them. 1- you never know where the data is coming from when you look at your html 2- They offer no easy way of caching the result. You can use the "widget pattern" to have much better performance and structure in your apps + many more bonuses ! :)
imanghafoo... 8 years ago 6438
This code shows how to trigger a Modal onScroll event to perform and assert against an ajax request
nezarfadle 8 years ago 8927