vdomah / octoexcel

OctoberCMS wrapper for Maatwebsite/Laravel-Excel
MIT License
14 stars 10 forks source link

Recently it stopped working on all of my sites #3

Closed bkrajendra closed 7 years ago

bkrajendra commented 7 years ago

Recently it stopped working on all of my sites. Its throwing error

Call to undefined method Vdomah\Excel\Classes\Excel::create()

I'm using it as:

function onStart()
{
    use Vdomah\Excel\Classes\Excel; //earlier was working without this
    $users =  RainLab\User\Models\User::all();
    $userArray = $users->toArray();

    Excel::create('ISBM-Staff', function($excel) use($userArray){

    $excel->sheet('User-List', function($sheet) use($userArray) {

        $sheet->fromArray($userArray);

    });

    })->download('xls');
}
vdomah commented 7 years ago

Yes, month ago plugin was rewritten due to issue reported. Now as stated in the README you need to call Excel::excel()->{method} instead of Excel::{method} https://github.com/vdomah/octoexcel

So it will be Excel::excel()->create in your case

bkrajendra commented 7 years ago

Thank you very much. Issue is resolved now!