Call to Undefined Function storeExcelView() using Maatwebsite

Asked

Viewed 26 times

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');
    });
}

1 answer

0

I was able to resolve some autoload libraries by inserting them into Composer files and then running the 'Composer dump-autoload -o' command then the dependencies were updated to php 7.2 and worked correctly

"autoload": { "psr-4": { "App ": "app/" }, "classmap": [ "database/Seeds", "database/Factories" ], "files": [
"app/Helpers/Menuhelper.php",
"app/Helpers/Datashelper.php",
"app/Helpers/Exports/Excel.php"
] },

Browser other questions tagged

You are not signed in. Login or sign up in order to post.