Level 102
That should work? How isn't it working?
if (Schema::hasTable('mytable')) {
//do stuff
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have some queries in AppServiceProvider and I want to check if table exists then run them.
I tried Schema like this:
if(Schema::hasTable('mytable'))
{
run query
}
but it didn't work.
Please or to participate in this conversation.