json(false);} $cookie = $_COOKIE['gtok']; $user = User::where('token', $cookie)->first(); $array = $user->toArray(); if (!$user) {return Response()->json(false);} return Response()->json(["data"=>$array]); }); Route::post('/maintenance/bypass', 'MaintenanceController@bypass'); Route::post('/account/register', 'Auth\RegisterController@create'); Route::post('/account/login', 'Controller@login'); Route::fallback(function(){ return response('{"errors":[{"code":404,"message":"NotFound"}]}', 404) ->header('Cache-Control', 'private') ->header('Content-Type', 'application/json; charset=utf-8'); });