All Questions

106
votes
9answers
74307 views

Laravel 5: Display HTML with Blade

I have a string returned to one of my views, like this: $text = '<p><strong>Lorem</strong> ipsum dolor <img src="images/test.jpg"></p>' I'm trying to display it with B...
70
votes
14answers
136331 views

Laravel stylesheets and javascript don't load for non-base routes

Okay--I know this is a really elementary issue, but I can't figure it out. This is a question regarding Laravel. Basically, I have my stylesheets embedded in my default layout view. I'm currently jus...
38
votes
6answers
36475 views

Laravel 5 - global Blade view variable available in all templates

I'm wondering how can I in Laravel 5 make global variable which will be available in all Blade templates?
134
votes
4answers
51070 views

What are the best practices and best places for laravel 4 helpers or basic functions?

So I'm trying to understand the best place to put a global function in laravel 4. For example: date formatting. I don't think making a facade is worth it, facades are too modular. I've read articles a...
28
votes
2answers
48447 views

How to include a sub-view in Blade templates?

I am trying to set up a site using laravel, but I'm really having trouble with basic things that the documentation just doesn't cover. In this case, I see that it says I can include one view inside a...
9
votes
4answers
31572 views

Laravel: How do I parse this json data in view blade?

Currently this is my view {{ $leads }} And this is the output {"error":false,"member":[{"id":"1","firstName":"first","lastName":"last","phoneNumber":"0987654321","email":"email@yahoo.com","owner":...
17
votes
3answers
13139 views

Where to place Blade::extend

I want to add the following code to my laravel project to support the break and continue statements in blade. This is the code: Blade::extend(function($value) { return preg_replace('/(\s*)@(break|...
167
votes
15answers
216891 views

How to get the current URL inside @if statement (blade) in Laravel 4?

I am using laravel 4. I would like to access to the current URL inside an @if condition in a view using the Laravel's Blade templating engine but I don't know how to do it. I know that it can be done...
34
votes
10answers
91712 views

Laravel-5 how to populate select box from database with id value and name value

I want to create a select box like the one below using illuminate\html : <select> <option value="$item->id">$item->name</option> <option value="$item->id">$it...
36
votes
4answers
59448 views

Truncate string in Laravel blade templates

Is there a truncate modifier for the blade templates in Laravel, pretty much like Smarty? I know I could just write out the actual php in the template but i'm looking for something a little nicer to ...

Previous Next