M
M
Morfeey2018-11-12 10:19:14
Laravel
Morfeey, 2018-11-12 10:19:14

Cron laravel, call, what's wrong?

I want to test cron in laravel.
There is the usual code in the schedule method:

$schedule->call(function () {
            file_put_contents(public_path(). DIRECTORY_SEPARATOR. "test.txt", "\nSite". rand(0, 99999));
            (new Site([
                "name" => "TEST",
                "url" => "http://test.ru",
                "region_yandex_id" => "213",
                "is_active" => true,
                "frequency_of_removal" => "everyMinute"
            ]))->save();
        })->everyMinute();

If these actions are performed without a wrapper in call(purely in the schedule method), then everything works fine, but there are some problems inside.
Where do I spit?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question