How to get custom header from HTTP response in Laravel 5?

Are you talking about get parameter or something? If so, use:

request()->accessing_from;

For header you should use:

request()->header('accessing_from');

The working solution for this was the answer (the last one) of daver here: Laravel get request header


Have you tried simple php?

<?php
// Replace XXXXXX_XXXX with the name of the header you need in UPPERCASE
$headerStringValue = $_SERVER['HTTP_XXXXXX_XXXX'];

Full answer: https://stackoverflow.com/a/541463/3548658

The docs says: https://laravel.com/api/5.3/Illuminate/Http/Request.html#method_header

use Request;
Request::header('accessing_from');