How-to articles, tricks, and solutions about LARAVEL-BLADE

Calculate difference between two dates using Carbon and Blade

To calculate the difference between two dates using Carbon and Blade, you can use the following steps:

Displaying the Error Messages in Laravel after being Redirected from controller

In Laravel, you can use the withErrors method to pass error messages to a view after a redirect.

Find last iteration of foreach loop in laravel blade

In Laravel Blade, you can use the @forelse loop to check if the last iteration of a loop has been reached.

How to Format Laravel Blade Code in Visual Studio Code?

You can use the Laravel Blade Snippets extension for Visual Studio Code to format Blade code in your Laravel projects.

Switch in Laravel 5 - Blade

In Laravel 5, the Blade templating engine provides a "switch" statement that allows you to compare a variable to multiple values and execute different code for each match.

Truncate string in Laravel blade templates

To truncate a string in a Laravel blade template, you can use the str_limit function.