0
I have the following problem, I’m getting this message:
Call to Undefined Function App Jobs Pit Reports Placar storeExcelView()
Detail: I am using PHP 7.2 and Laravel 6. The same code in PHP 5.6 and Laravel 5.5 works normally, could help me?
Controller Code
$rota = 'administrativo.pit.relatorio.atividades.excel.placar_horas';
storeExcelView($dados, 'datas', $this->user, $name, $rota);
Code for Helpers/Excel
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Storage;
use Maatwebsite\Excel\Facades\Excel;
use App\Exports\Excel\CollectionExport;
use App\Exports\Excel\ViewExport;
function storeExcelView($datas, $name, $user, $nameExcel, $rota){
$nomenclatura = $user->cod_usuario.''.date("Ymdhms").'-'.$nameExcel.'.xlsx';
Excel::store(new ViewExport($rota, [$name => $datas]), $nomenclatura, 's3');
$url = Storage::disk('s3')->temporaryUrl($nomenclatura, now()->addDay());
$data = array('title' => "Gerador de arquivos do E-Metodo",
'name' => $nameExcel,
'url' => $url);
Mail::send('administrativo.mails.exports.arquivos.email', $data, function($message) use($user){
$message->to($user->dsc_email, 'E-mail')
->subject('Gerador de arquivos')
->from('[email protected]', 'TI');
});
}