All Questions

19
votes
5answers
8359 views

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 {!! !!} syntax in blade files of Laravel. What is the difference between them?
14
votes
4answers
9695 views

Is there any way to compile a blade template from a string?

How can I compile a blade template from a string rather than a view file, like the code below: <?php $string = '<h2>{{ $name }}</h2>'; echo Blade::compile($string, array('name' => '...
1
votes
2answers
4439 views

Laravel 5.1 pass data from view to modal

How can I pass data from blade view to modal dialog : For example : I pass $user from controller to view : $user = User::findOrFail($id); return view('user.show')->withUser($user); Next, I wa...
1
votes
1answers
1656 views

Laravel 5.4 blade foreach loop

I am building a venue manangement system, and on the landing page, i m trying to show all the available slots to the visitors. The ones that have already been booked are shown as not available. I have...
3
votes
1answers
759 views

POEdit doesn't extract string in HTML tags

I'm having a problem with Laravel's blade templating syntax. When having something like: <input placeholder="{{ __('My Tooltip') }}" /> that string won't be founded by POEdit. But on same fi...
10
votes
2answers
19604 views

laravel 5.2 How to get route parameter in blade?

this is my url http://project.dev/blogs/image-with-article so, here I need the parameter image-with-article in my blade to display which is a parameter named slug here is in my routes file I need the ...
3
votes
2answers
5268 views

Change language in Laravel 5

I just begin to use Laravel 5.4, In the login.blade.php i have I don't like to put plain text in html code, is there a solution to make all the texts in seperate lang files to use them dynamically...
3
votes
1answers
1355 views

Check if a view exists and do an @include in Laravel Blade

With Laravel Blade, is there an elegant way to check if a view exists before doing an @include? For example I'm currently doing this: @if(View::exists('some-view')) @include('some-view') @endif ...
5
votes
5answers
8031 views

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) <option value={!! $v->id !!} {{ $colors->last()->id==$v->id ? 'select...
4
votes
5answers
2346 views

Create comma separated list from array in laravel/blade?

I am displaying elements of an array @foreach($tags as $tag)$tag->@endforeach. The output is tag1tag2tag3. What is the possible way to sho elements of array in tag1,tag2,tag3. And how to not show, ...

Previous Next