dimanche 13 mars 2016

Error when importing Excel file

when i try to import excel file using laravel 5.1 maatweb package , i receive the following error

Serialization of 'Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed the function as below :

public function import()
    {
        $file=Input::file("file");

      // Excel::load($file, function($reader)
            Excel::load($file)->chunk(100, function($reader)
        {
            $results = $reader->get();
            foreach($results as $row):
               Vlist::create([
                    'vname'           =>$row->vname,
                    'vservice'        =>$row->vservice,
                    'vphone'          =>$row->vphone,
                    'vmobile'         =>$row->vmobile,
                    'vemail'          =>$row->vemail,
                    'vcontactperson'  =>$row->vcontactperson,
                    'vaddress'        =>$row->vaddress,
                    'vegpcno'         =>$row->vegpcno,
                    'vcapitallimit'   =>$row->vcapitallimit,
                    'vgrade'          =>$row->vgrade,
                    'vremarks'        =>$row->vremarks,
                    'user_id'        =>Auth::user()->id
                ]);
            endforeach;
        });
        return redirect('vlist');
    }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire