<?php
namespace AppHttpControllers;
use IlluminateHttpRequest;
use IlluminateSupportFacadesDB;
class EventController extends Controller
{
public function index(Request $request)
{
$id = $request->query('id');
$event = DB::table('events')->where('id',$id)->get();
$pics = DB::table('pictures')->where('event_id',$id)->get();
return view('pages.eventPage',compact('event','pics'));
}
}
public function index(Request $request)
{
....
return view('pages.eventPage', compact('id', 'event', 'n'));
}
@for($i = 1; $i < count($pics); $i++)
<li data-target="#carousel-example-generic" data-slide-to="{{ $i }}"></li>
@endfor
Route::get('eventpage', 'EventController@index')->name('eventpage');