Answer the question
In order to leave comments, you need to log in
How to output array from Laravel controller?
There is an array
$gridLinks = [
[
'title' => 'Пользователи',
'icon' => 'images/cabinet/resume.svg',
'route' => 'adminUser'
],
[
'title' => 'Новости',
'icon' => 'images/cabinet/resume.svg',
'route' => 'home'
],
[
'title' => 'Отзывы',
'icon' => 'images/cabinet/resume.svg',
'route' => 'home'
],
[
'title' => 'Города/Районы/Микрорайоны',
'icon' => 'images/cabinet/resume.svg',
'route' => 'home'
],
[
'title' => 'Категории',
'icon' => 'images/cabinet/resume.svg',
'route' => 'home'
],
[
'title' => 'Выйти',
'icon' => 'images/cabinet/exit.svg',
'route' => 'logout'
]
];
return view('admin.index', compact('gridLinks'));
dd($gridLinks);
@foreach($gridLinks as $link)
<a class="gridLinksItem" href="">
<h3 class="gridLinksItem__title">{{ $link->title }}</h3>
</a>
@endforeach
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question