Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

swarley_HIMYM's avatar

laravel migrations

heyy guys, i wanna ask about laravel migration. how to create migrations table without S ? i already,edit schema name and create without s but when im create export table to excel laravel showing the error like this:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'inventori.stocks' doesn't exist (SQL: select * from stocks)

thanks rully

0 likes
2 replies
bobbybouwmann's avatar

It depends on what you have in your migration I guess? Can you post your migration here?

Also, if you have a model and you don't use the standard table name with an extra s you need to tell the model that the name is different

class Stock extends Model
{
    protected $table = 'stock';
}

Otherwise, it will always try to use the plural version of the model.

Please or to participate in this conversation.