Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vandan's avatar
Level 13

Unable to open file for reading [HTTP/1.0 200 OK Cache-Control: public Content-Disposition: attachment; filename="Sales Register 2019 Cr.xlsx" Date: Tue, 16 Apr 2019 12:22:06 GMT Last-Modified: Tue, 16 Apr 2019 12:22:06 GMT ]

try to mail send when file csv file export

$file = Excel::download(new UsersExport, 'Sales Register 2019 Cr.xlsx');

    $data = array('name'=>"byte and bits");
     
    \Mail::send('front.mail', $data, function($message) use($file){
            
    $message->to('[email protected]')
            
    ->subject('Sales Register 2019 Excelsheet');
            
    $message->from('[email protected]','byte and bits');
            
    $message->attach($file);                                      
        
});

    User::truncate();
    
return $file;
0 likes
1 reply
vandan's avatar
Level 13

basename() expects parameter 1 to be string, object given

Please or to participate in this conversation.