Category: Laravel, PHP, javascript

A blog on PHP, JavaScript and more Amit Merchant · July 31, 2020 · ⋆ Laravel There are some features in Blade, which if used appropriately, can make your codebase look more organized and recognizable. One such feature that I recently came across is where one can create their own custom conditional Blade directives which you can use in your codebase. This kind of Blade directives can come in handy if you don’t want to spoil your Blade views by throwing in the complex logic and to make your views much cleaner.

So, if you want to create a custom conditional directive which checks the type of book and returns the boolean result accordingly, you can do it like so.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners