laravel response header code example
Example 1: laravel get header from request
public function yourControllerFunction(\Illuminate\Http\Request $request)
{
$header = $request->header('Authorization');
// do some stuff
}
Example 2: laravel return response json
return response()->json([
'name' => 'Abigail',
'state' => 'CA',
]);
Example 3: laravel return response view
return response()->view('your_view', compact('variableName'));