1public function index(Request $request)
2{
3 ....
4
5 return view('pages.eventPage', compact('id', 'event', 'n'));
6}
1<?php
2namespace App\Http\Controllers;
3
4use Illuminate\Http\Request;
5use Illuminate\Support\Facades\DB;
6
7 class EventController extends Controller
8{
9
10public function index(Request $request)
11{
12 $id = $request->query('id');
13 $event = DB::table('events')->where('id',$id)->get();
14 $pics = DB::table('pictures')->where('event_id',$id)->get();
15
16return view('pages.eventPage',compact('event','pics'));
17
18}
19
20}
1@for($i = 1; $i < count($pics); $i++)
2<li data-target="#carousel-example-generic" data-slide-to="{{ $i }}"></li>
3@endfor