I work with Laravel Task Scheduling, but I have a problem when I call some method from my controller.
protected function schedule(Schedule $schedule)
{
$
Also now I test with more simple function to insert new currency in database. Here is code:
public function handle()
{
$currency = new Currency();
$currency->currency_name = 'EUR';
$currency->save();
$this->info('New currency is successfully generated!');
}
This function is from laravel/app/Console/Commands. I call from Kernel > schedule(). Not work.
When I insert simple log write to handle() function like:
File::put(base_path() . '/storage/logs/test_logs.txt', 'Test log ' . Carbon::now()->format('Y-m-d H:i:s') . PHP_EOL);
this works. But when I try to create new object from Models and save into db -> this not work.