Laravel Community Tools by Tighten

laraning

Joined: 8 years ago
Total tricks: 7
Last trick: 7 years ago

Submitted tricks

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 3989
Sometimes you have a blade view, and you would like to render a certain HTML code only if your controller action is the one you passed in the directive.
laraning 8 years ago 4309
Sometimes you want to refer your custom middleware not by the full qualified namespace class, but only by an alias (E.g. like the ones that Laravel have created in the Middleware Kernel).
laraning 8 years ago 7263
We don't like to duplicate a form for the "create" and "edit" methods. But how can you then put a value using the old and at the same time using the model attribute value without raising an exception?
laraning 8 years ago 3834
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 7595
The optional helper now can have a callback to execute in case the first argument is null.
laraning 7 years ago 3489
You might come up with a situation where you want to check if a given Eloquent attribute was changed compared with its original stored value.
laraning 7 years ago 25114