samedi 27 octobre 2018

Non-static method Maatwebsite\Excel\Readers\LaravelExcelReader::all() should not be called statically, assuming $this from incompatible context

I'm getting this error whenever trying to upload and excel file

My function is

use Illuminate\Support\Facades\Input;
use Excel;

function:-

public function importProduct(){
$file = Input::file('file');
$file_name = $file->getClientOriginalName();
$file->move('excelData/',$file_name);
$result = \Excel::load('excelData/'.$file_name, function($reader){
$reader::all();
})->get();
return json_encode($result);
}



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2CIsLfE
via IFTTT

Aucun commentaire:

Enregistrer un commentaire