Merge branch 'master' into LiveSearch

This commit is contained in:
Neerholt
2020-07-27 14:23:13 +02:00
committed by GitHub
41 changed files with 439 additions and 134 deletions
@@ -29,8 +29,11 @@ class EventController extends Controller
*/
public function index(Request $request)
{
$events = Event::query()->paginate($request->input("limit", 20));
//returns the function with events index page and a parameter of events.
//also Response::detect checks screen size to determine if user is on a computer or mobile.
return Response::detect("events.index", [ "events" => $events]);
}
@@ -41,6 +44,7 @@ class EventController extends Controller
*/
public function create()
{
//returns "create event" blade
return Response::detect("events.create");
}
@@ -58,6 +62,7 @@ class EventController extends Controller
"date" => "required"
]);
//creates a new Event model with the given parameter
$event = new Event($requestBody);
$saved = $event->save();