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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners