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 3958
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 4284
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 7217
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 3817
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 7542
The optional helper now can have a callback to execute in case the first argument is null.
laraning 7 years ago 3466
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 25058