Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to update specific column table value after create migrations Laravel?

currently I want to update my existing table by adding new column. Let’s say the column name is is_active with default value is true. I create new migrations for this.

Then I want to update specific item within this table so the is_active column is changed to false. How to do this without doing this directly to the database so my teammate can also get this changes?

Should I create new seeder and call it within my migration?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You have to make query to update your is_active for specific column something like this:

Model::where('id', $id)->update(['is_active' => 'false']);
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading