vendredi 24 août 2018

Call an Excel function inside CronJob

I'm trying to call a function i have created in my Controller inside my cronjob. But I don't know the code to do it. So instead i tried to paste the code that was inside my controller's function inside my public handle() .

It shows an error :

In Connection.php line 664:

 SQLSTATE[42S02]: Base table or view not found: 1146 Table 'buy_backs' doesn't exist (SQL: select * from `buy_backs` order by `id` asc)


In Connection.php line 326:

 SQLSTATE[42S02]: Base table or view not found: 1146 Table 'buy_backs' doesn't exist

This is the code i pasted in my cronjob:

public function handle()
{
    Excel::store(new BuyBackStockExport(2018), 'buybacks.xlsx', 'system');      
}

My function just stores that excel sheet to my system disk. Can anyone suggest me a solution? Please help.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire