When you're working with database in your Laravel project, and you have a table that is already migrated. Now, if you are looking to add a new column to the database table you cannot just simple edit the old migration file to add the column.

Create a new migration file. Let's say you are looking to add a new field named meta to your posts table.

You then need to use the Schema::table() method (as you're accessing an existing table, not creating a new one).
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners