Reputation: 481
I can't figure out what I'm doing wrong here. I'm including a return from a database in my controller into my blade
when I dump it
<?php dd($count)?>
I get
array:1 [▼
0 => array:1 [▼
"STORES" => "40"
]
]
But in the blade where I have
Count: {{$count['STORES']}}
It shows Count: and then it's blank after that. The database return only ever returns one count and I'd like to get this working to say "If return is null, set $count['STORES'] = 1, else use $count['STORES']
Upvotes: 0
Views: 667
Reputation: 908
You have a multidimensional array. There is no key "STORES" at the 1st level. Only the Key 0. The blade should be
Count: {{$count[0]['STORES']}}
Upvotes: 2