message('Hello, world!'); } /** * Handles /hello * * @param Request $request * * @return mixed */ public function hello(Request $request) { // Another way to return JSON, this for a custom response // It's recommended to use Resources for responses from the database return response()->json([ 'name' => Auth::user()->name, ]); } }