i guess because by the time the first has run it's no longer time to run the second.
I don't know if this is a demo example but you could just run them both together in the same schedule?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have written a crawler that is taking some data from a website, and I want to run it everyMinute, just to test it.
Here is code
protected function schedule(Schedule $schedule)
{
$schedule->call(function () {
$crawler = new Crawler();
$crawler->crawlVideos("someUrl",20);//20 is how many pages to crawl
})->everyMinute();
$schedule->call(function () {
$crawler = new Crawler();
$crawler->crawlImages("someUrl",20);//20 is how many pages to crawl
})->everyMinute();
}
When I run php artisan schedule:run, it is crawling, it takes data and write them into DB, but ONLY from crawlVideos() function. If I change 20 to 2 or 3(how many pages to crawl), both functions are working, and I can see data in my DB.
Can someone tell me what is the problem ?
Please or to participate in this conversation.