laravel-blade Questions

5

Solved

I did a redirect in laravel: return redirect('admin')->with($returnData); $returnData is a string that contains a bootstrap info div with the result from the controller. Almost everything is ...
Cusk asked 23/8, 2015 at 22:38

5

I need to check 2 routes, and if one is true, add some content @if (Route::current()->uri() != '/' || Route::current()->uri() != 'login')<div>add some content some contnt </div> ...
Jerricajerrie asked 3/2, 2020 at 22:20

5

Solved

In the Blade templating engine, how to use "if" to determine null or empty? {{{ Auth::user()->age }}}
Dualism asked 14/5, 2015 at 18:23

3

Solved

I've been running into some issues with Laravel's middleware. Let me tell you the basic idea of what I'm trying to accomplish: Registered users on the site will have one of four roles: Student (...
Hectorhecuba asked 10/5, 2017 at 19:59

2

Solved

i would like to pass an array as parameter from my controller to the blade template. My controller looks like this: $myArray = array('data' => 'data'); return View::make('myTableIndex') ->...
Canvasback asked 17/2, 2016 at 14:12

2

Solved

I'm using last version of PhpStorm v2019.2. In this version take Undefined Variable for all passed variable to view from controller @foreach( $specifications as $specification ) @php $type_spec ...
Vacillatory asked 16/9, 2019 at 16:58

2

Solved

I would like to use React js as a front-end for my laravel project . So i did the preset with: php artisan preset react Now i would like to know, how react component should be implemented in my ...
Clump asked 15/4, 2018 at 14:41

3

Solved

ihave a route to get artists initial letter. this is my route Route::get('/artists/{letter}', 'HomeController@showArtist')->where('letter', '[A-Za-z]+')->name('list'); and this is my con...
Remarkable asked 12/3, 2017 at 19:36

5

Solved

Here is my login.blade.php @if(Session::get('errors')||count( $errors ) > 0) @foreach ($errors->all() as $error) <h1>{{ $error }}</h1> @endforeach @endif Here is my LoginCon...
Polypropylene asked 3/11, 2017 at 21:57

4

Solved

I have a vue template that contains a form: <form id="logout-form" :action="href" method="POST" style="display: none;"> {{ csrf_field() }} </form> In laravel, forms must have a csrf...
Barilla asked 5/8, 2017 at 14:38

2

Solved

I want to extend template based on condition. I know i can use @if @else statement in blade. I am doing the same thing, but blade extending both the template. I don't know why. @if(isset(Auth::use...
Duong asked 4/3, 2016 at 9:31

5

Solved

How to @include a blade template only if it exists ? I could do something like that : @if (File::exists('great/path/to/blade/template.blade.php')) @include('path.to.blade.template') @endif But ...
Shovelhead asked 19/8, 2015 at 17:48

3

Solved

I would like to check whether an asset {{ asset }} exists before trying to output the file. I have tried a few things after some google-ing, but none seem to work on Laravel 5.0. An example of w...
Selfappointed asked 8/5, 2015 at 16:9

6

Solved

I am writing the logic for an edit form and have some complications when displaying data in the inputs. When I initially show the form, I show the records values like: value="{{$dog->t...
Tannenberg asked 19/7, 2016 at 14:41

2

Solved

I have variable {{$template}}.. How can I do for including that variable to @extends. I had try like this: @extends({{$template}}) // getting error I hope, there is one answer to help me. Than...
Valve asked 21/9, 2015 at 10:9

4

Solved

Hey as i am passing a blade view which is having it own controller also i am including it into the view which does not have its own controller. it gives me an undefined variable error can any one h...
Tachymetry asked 30/9, 2016 at 10:20

5

Laravel 5.4 Blade introduced the concept of components & slots - but I can't see what they add over the traditional @include. As I understand, with component/slots, you do: In template compone...
Fredela asked 27/5, 2017 at 2:21

1

Solved

I have data in my database that may contains curly braces{{ }}. {{-- inside app.blade.php --}} <!-- vue app --> <div id="app"> ...code <div> {{ $data }} </div> ...
Michaeu asked 27/8, 2020 at 10:37

4

In laravel blade system when we want to include a partial blade file we have to write the full path every time for each file. and when we rename a folder then we will have to check every @include o...
Commanding asked 18/4, 2018 at 7:58

7

Solved

Using Laravel blade template, is there a way to include a variable and increase each time in the foreach or what is better approach? For example: @foreach($categories as $category) <li>&lt...
Psychopath asked 18/6, 2015 at 15:12

3

Solved

My question is very simple. i use blade in laravel to show the images like <img src="{{asset('assets/images/image.jpg')}}"> but what if my image is dynamic like: <img src="{{asset('ass...
Valenzuela asked 17/5, 2014 at 15:14

8

Solved

I create a view by doing an eloquent query and then pass it over to Blade. @if($contacts != null) //display contacts @else You dont have contacts @endif However it always assume that $contacts h...
Calisaya asked 21/12, 2016 at 18:8

6

Solved

I have a url : http://localhost:8888/projects/oop/2 I want to access the first segment --> projects I've tried <?php echo $segment1 = Request::segment(1); ?> I see nothing print out in m...
Isreal asked 5/8, 2015 at 12:39

2

Solved

@foreach($last_articles->chunk(3) as $row) @foreach($row as $last_article) @if($loop->index!=0) {{"in $loop"}} @endif @endforeach @if($loop->index!=0) {{"out $loop"...
Emmenagogue asked 9/7, 2017 at 18:20

3

Solved

So essentially all of my views are using the header.blade.php since I am including it in my master layout. I need to pass data to the header on every single view. Is there a way to pass data just t...
Synergy asked 6/5, 2016 at 15:12

© 2022 - 2024 — McMap. All rights reserved.