header laravel json code example Example: set header as json in laravel return response()->json([ 'name' => 'Abigail', 'state' => 'CA', ]);