Would this be an acceptable solution:
if(Schema::hasTable('settings')){
$schedule->command('foo:bar')->dailyAt(......
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hey Guys,
I have scheduled a command to do some processing at a time which is configured in a database table.
The problem I have found is that with a fresh install, php artisan migrate:fresh (or any artisan command) fails to say it cant find the table, how do I skip this command when doing my initial deployment ? Or is there a better place for this command ?
$schedule->command('foo:bar')->dailyAt(Setting::find('foo_deadline')->value);
Error:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'foo.settings' doesn't exist
Please or to participate in this conversation.