public function download()
    {
        set_time_limit(0);
        ini_set('max_execution_time', 0);
        ignore_user_abort();


        $datatable = app(ActivityLogs::class);

        list($headers, $data) = $this->prepareHeadersAndKeys($datatable);
        $items = $this->prepareContent($datatable, $data);

        $top      = implode(self::separator, $headers);
        $content  = implode("\n", $items);
        $csv      = implode("\n", [$top, $content]);
        $date     = date('Y_m_d_H_i_s', time());
        $filename = "activity_log_{$date}.csv";

        return response($csv, 200, [
            'Content-Type'              => 'text/csv',
            'Content-Description'       => 'File Transfer',
            'Content-Disposition'       => 'attachment; filename=' . $filename,
            'Content-Transfer-Encoding' => 'binary',
            'Connection'                => 'Keep-Alive',
            'Expires'                   => '0',
            'Cache-Control'             => 'must-revalidate, post-check=0, pre-check=0',
            'Pragma'                    => 'public',
            'Content-Length'            => strlen($csv)]);
    }
public function download()
    {
        set_time_limit(0);
        ini_set('max_execution_time', 0);
        ignore_user_abort();


        $datatable = app(ActivityLogs::class);

        list($headers, $data) = $this->prepareHeadersAndKeys($datatable);
        $items = $this->prepareContent($datatable, $data);

        $top      = implode(self::separator, $headers);
        $content  = implode("\n", $items);
        $csv      = implode("\n", [$top, $content]);
        $date     = date('Y_m_d_H_i_s', time());
        $filename = "activity_log_{$date}.csv";

        return response($csv, 200, [
            'Content-Type'              => 'text/csv',
            'Content-Description'       => 'File Transfer',
            'Content-Disposition'       => 'attachment; filename=' . $filename,
            'Content-Transfer-Encoding' => 'binary',
            'Connection'                => 'Keep-Alive',
            'Expires'                   => '0',
            'Cache-Control'             => 'must-revalidate, post-check=0, pre-check=0',
            'Pragma'                    => 'public',
            'Content-Length'            => strlen($csv)]);
    }
public function download ( ) { set_time_limit ( 0 ) ; ini_set ( 'max_execution_time' , 0 ) ; ignore_user_abort ( ) ; $ datatable = app ( ActivityLogs :: class ) ; list ( $ headers , $ data ) = $ this -> prepareHeadersAndKeys ( $ datatable ) ; $ items = $ this -> prepareContent ( $ datatable , $ data ) ; $ top = implode ( self :: separator , $ headers ) ; $ content = implode ( "\n" , $ items ) ; $ csv = implode ( "\n" , [ $ top , $ content ] ) ; $ date = date ( 'Y_m_d_H_i_s' , time ( ) ) ; $ filename = "activity_log_{$date}.csv" ; return response ( $ csv , 200 , [ 'Content-Type' => 'text/csv' , 'Content-Description' => 'File Transfer' , 'Content-Disposition' => 'attachment; filename=' . $ filename , 'Content-Transfer-Encoding' => 'binary' , 'Connection' => 'Keep-Alive' , 'Expires' => '0' , 'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0' , 'Pragma' => 'public' , 'Content-Length' => strlen ( $ csv ) ] ) ; }
Download actvity log

@return \Symfony\Component\HttpFoundation\Response
Download actvity log