public function fileDownload()
    {
        if ($response = $this->session->get('administrator_download_response')) {
            $this->session->forget('administrator_download_response');
            $filename = substr($response['headers']['content-disposition'][0], 22, -1);

            return response()->download($response['file'], $filename, $response['headers']);
        } else {
            return redirect()->back();
        }
    }
public function fileDownload()
    {
        if ($response = $this->session->get('administrator_download_response')) {
            $this->session->forget('administrator_download_response');
            $filename = substr($response['headers']['content-disposition'][0], 22, -1);

            return response()->download($response['file'], $filename, $response['headers']);
        } else {
            return redirect()->back();
        }
    }
public function fileDownload ( ) { if ( $ response = $ this -> session -> get ( 'administrator_download_response' ) ) { $ this -> session -> forget ( 'administrator_download_response' ) ; $ filename = substr ( $ response [ 'headers' ] [ 'content-disposition' ] [ 0 ] , 22 , - 1 ) ; return response ( ) -> download ( $ response [ 'file' ] , $ filename , $ response [ 'headers' ] ) ; } else { return redirect ( ) -> back ( ) ; } }
The GET method that runs when a user needs to download a file.

@return JSON
The GET method that runs when a user needs to download a file .