diff --git a/src/Http/Controllers/EventsController.php b/src/Http/Controllers/EventsController.php index 8a6cae9..20d9f29 100644 --- a/src/Http/Controllers/EventsController.php +++ b/src/Http/Controllers/EventsController.php @@ -10,10 +10,9 @@ class EventsController public function index(Request $request) { $events = Event::filter($request->query()) - ->get(['id', 'title', 'start', 'end']) - ->toJson(); + ->get(['id', 'title', 'start', 'end']); - return response($events); + return response()->json($events); } public function store(Request $request) @@ -73,4 +72,4 @@ public function destroy(Request $request, $eventId) return response()->json(['error' => true]); } -} \ No newline at end of file +}