Populating a database in a Laravel migration file

前端 未结 7 1868
不知归路
不知归路 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:32

    This should do what you want.

    public function up()
    {
        DB::table('user')->insert(array('username'=>'dude', 'password'=>'z19pers!'));
    }
    
    0 讨论(0)
提交回复
热议问题