Top "Laravel-blade" questions

Blade is the simple, yet powerful templating engine provided with Laravel.

Find last iteration of foreach loop in laravel blade

In blade template i use last() method to find last iteration of foreach loop: @foreach ($colors as $k => $v) &…

php laravel laravel-5 blade laravel-blade
What is the best practice to show old value when editing a form in Laravel?

I am writing the logic for an edit form and have some complications when displaying data in the inputs. When …

laravel validation laravel-blade
Blade inline if and else if statement

Is there a syntax to specify inline if and else if statement in Laravel blade template? Normally, the syntaxt for …

laravel-5 laravel-blade
How to get Blade template view as a raw HTML string?

I need the HTML of my Blade template as a string. I'm going to use that HTML string to generate …

php laravel laravel-blade
Get last part of current URL in Laravel 5 using Blade

How to get the last part of the current URL without the / sign, dynamically? For example: In www.news.com/…

laravel laravel-5 laravel-5.2 laravel-5.1 laravel-blade
Laravel middleware with multiple roles

I've been running into some issues with Laravel's middleware. Let me tell you the basic idea of what I'm trying …

php laravel-5.4 laravel-blade laravel-middleware
How to display something only for the first item from the collection in Laravel Blade template

I have a @foreach loop in the Blade template and need to apply special formatting to the first item in …

php laravel-5.1 laravel-blade
What is the difference between {{ }} and {!! !!} in laravel blade files?

In the laravel framework we can use blade to add PHP code in html file. We are using both {{ }} and {!! !!} …

php laravel laravel-5.2 laravel-blade
Checking which `guard` is loggedin

I have a multiauth laravel 5.2 app, with the fallowing guards defined on config/auth.php: ... 'admin' => [ 'driver' => 'session', …

php laravel laravel-5 laravel-blade laravel-authentication
How to fetch current locale in view in Laravel 5.3

I am making a bilingual app. I am using same routes for each but I am using different views for …

laravel laravel-5.3 blade laravel-blade