Answers for "get all headers laravel"

PHP
1

laravel get header from request

public function yourControllerFunction(\Illuminate\Http\Request $request)
{
    $header = $request->header('Authorization');

    // do some stuff
}
Posted by: Guest on November-03-2020
0

check for headers laravel

// Returns header value with default as fallback
$request->header('some_header', 'default_value');

// Returns boolean
$request->headers->has('some_header');
Posted by: Guest on August-03-2021

Browse Popular Code Answers by Language