laravel-blade Questions

7

Solved

In Laravel blade you can do: {{ $variable or 'default' }} This will check if a variable is set or not. I get some data from the database, and those variables are always set, so I can not use th...
Och asked 15/12, 2014 at 14:23

8

Solved

Currently this is my view {{ $leads }} And this is the output {"error":false,"member":[{"id":"1","firstName":"first","lastName":"last","phoneNumber":"0987654321","email":"[email protected]...
Tabret asked 6/5, 2015 at 9:44

6

Solved

Does anyone know how to pass a given variable instead the Carbon's default parameters ? The documentation of Carbon says: // CARBON SAMPLE $dtToronto = Carbon::createFromDate(2012, 1, 1, 'Americ...
Bell asked 15/9, 2016 at 10:37

5

Solved

I'm currently learning laravel and creating my first form. Everything is awesome until I want to use {{ old('') }} helper in my blade file for radio buttons. I'm not sure how to go about doing it p...
Kura asked 15/10, 2015 at 6:7

3

Solved

I'm trying to build a javascript array of data for use in flot from the result of a php DB query. When I'm outputting numbers ($lic->Users) it's fine, but whenever I try to output a string I get a...
Rutty asked 26/8, 2013 at 13:53

31

Solved

I'm reading the Laravel Blade documentation and I can't figure out how to assign variables inside a template for use later. I can't do {{ $old_section = "whatever" }} because that will echo "whatev...
Onofredo asked 21/10, 2012 at 22:2

3

Solved

I am trying to get hours and minutes and seconds in blade, normally I use like below {{$calllog['delivery_date']}} but now my requirement is to get hours and minutes and seconds. here is how I t...
Debit asked 24/7, 2017 at 16:26

6

I want to show an array in my .blade.php, but it does not work properly so my controller looks like this: class WatchController extends Controller { public function index() { $watchFolderPath ...
Voluble asked 16/3, 2016 at 7:42

6

My function returns an array to a variable in laravel blade page like this : Array ( [id] => 1 [name] => Enterpise [children] => Array ( [0] => Array ( [id] => 2 [name] =&gt...
Presumably asked 29/6, 2015 at 9:19

4

Solved

I am using Laravel 5.6. This page did not work for me. pizza/index.blade.php looks like this: @extends('layouts.app') @section('content') <!-- Styles --> <link href="{{ asset('css/p...
Surbased asked 30/7, 2018 at 10:35

9

Solved

I have a @foreach loop in the Blade template and need to apply special formatting to the first item in the collection. How do I add a conditional to check if this is the first item? @foreach($item...
Roi asked 25/11, 2015 at 16:46

9

Solved

I want a dynamic number of rows in a table like this. number name 1 Devy This my Blade template. <thead> <th>number</th> <th>name</th> </thead> <tbody&g...
Interrupted asked 9/5, 2015 at 17:15

5

Solved

If I have a layout called RightSideBar.blade.php in Laravel blade, one area yield('content') and the other yield('sidebar'). Is there a built in way to display a default partial if the view that ...
Turpentine asked 3/7, 2014 at 9:15

2

Solved

I have a custom function and I want to pass it in a blade template. Here is the function: function trim_characters( $text, $length = 45, $append = '…' ) { $length = (int) $length; $t...
Bridesmaid asked 7/9, 2015 at 2:13

4

Solved

i am building a laravel aplication and i have this line of code which should redirect the user back to form he just submited , with the old input and the result of some operations . return back(...
Slipperwort asked 22/8, 2017 at 10:3

10

Solved

My image file path is public/img/stuvi-logo.png and my app.blade.php file path is resources/views/app.blade.php Inside of my app.blade.php file I use {{HTML::image('/img/stuvi-logo.png')}} to displ...
Unalienable asked 24/4, 2015 at 21:49

9

Solved

How can I use switch in blade templates? When I used: @switch($login_error) @case(1) `E-mail` input is empty! @break @case(2) `Password` input is empty! @break @endswitch in result I see t...
Downtime asked 27/4, 2015 at 13:42

3

Solved

In Laravel 5 I have a master template containing: <title>@yield('title') | Site Name</title> And in my view I have: @extends('master') @section('title', $client->name) ... Th...
Semiyearly asked 24/11, 2015 at 18:6

5

Solved

How can I call a native PHP function str_replace() in my Laravel 4 blade file? I want to convert my snake_case values to space-separated words using str_replace(). I am trying this php code but it'...
Roodepoortmaraisburg asked 5/1, 2015 at 6:45

5

Solved

So I want to keep linebreaks from the database while using the Blade Template Engine. I came up on the idea using {!! nl2br(e($task->text)) !!} It works. But it looks like a needlessly compli...
Hoxie asked 17/2, 2015 at 19:51

10

Solved

How to get the last part of the current URL without the / sign, dynamically? For example: In www.news.com/foo/bar get bar. In www.news.com/foo/bar/fun get fun. Where to put the function or how...
Rosabella asked 19/6, 2016 at 12:23

3

Solved

So i integrated this package to my application, https://github.com/thekordy/ticketit and this package has its own view and i want to modify the views like the create.blade.php,.. how would i do thi...
Unbuild asked 30/4, 2017 at 13:18

3

Solved

In Laravel, there are different ways of using sections: @yield('section1') // Filled in by child view @section('section2') // Default content, can be overwritten by child // Different ways of c...
Fractionate asked 25/5, 2018 at 13:24

11

Solved

In my code I am using typeahead.js. I use Laravel 5 and I need to replace the var states with my {{ $jobs }} variable. I need to list all Job Titles as an array. In my controller I have $jo...
Greasepaint asked 27/3, 2015 at 19:10

8

Solved

I have a multiauth laravel 5.2 app, with the fallowing guards defined on config/auth.php: ... 'admin' => [ 'driver' => 'session', 'provider' => 'admin', ], 'user' => [ 'driver' =&gt...
Autohypnosis asked 17/8, 2016 at 14:40

© 2022 - 2024 — McMap. All rights reserved.