こういうことをしたいってことなのかな…
php
1Route::get('/test2', function (Illuminate\Http\Request $request) {
2 $products = [
3 (object)["title" => 1],
4 (object)["title" => 2],
5 (object)["title" => 3],
6 (object)["title" => 4],
7 (object)["title" => 5],
8 (object)["title" => 6],
9 (object)["title" => 7],
10 ];
11 $artists = [
12 (object)["title" => 11],
13 (object)["title" => 22],
14 (object)["title" => 33],
15 (object)["title" => 44],
16 (object)["title" => 55],
17 (object)["title" => 66],
18 (object)["title" => 77],
19 ];
20
21
22 return view('test2', ['products' => $products, 'artists' => $artists]);
23});
php
1<html>
2<head>
3<meta name="csrf-token" content="{{ csrf_token() }}">
4<link rel="stylesheet" href="{{ mix('/css/app.css') }}">
5</head>
6<body>
7<div id="app">
8<example-component></example-component>
9</div>
10@foreach (['products', 'artists'] as $v)
11 @foreach ($$v as $data)
12 {{ $data->title }}
13 @endforeach
14@endforeach
15<script>
16</script>
17</html>
※私的には@includeやらで分割したほうがいい気もする
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/06/04 23:46
2020/06/05 00:10