Populating a database in a Laravel migration file

前端 未结 7 1884
不知归路
不知归路 2020-12-07 10:31

I\'m just learning Laravel, and have a working migration file creating a users table. I am trying to populate a user record as part of the migration:

public          


        
7条回答
  •  再見小時候
    2020-12-07 11:16

    If you already have filled columns and have added new one or you want to fill out old column with new mock values , do this:

    public function up()
    {
        DB::table('foydabars')->update(
            array(
                'status' => '0'
            )
        );
    }
    

提交回复
热议问题