database/seeds/UsersTableSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        DB::table('users')->insert([
            'name' => 'Admin',
            'email' => 'admin@gmail.com',
            'password' => Hash::make('secret'),
            'role' => 'admin'
        ]);
        for($i=0; $i<20; $i++){
            DB::table('users')->insert([
                'name' => Str::random(10),
                'email' => Str::random(10).'@gmail.com',
                'password' => Hash::make('password'),
                'role' => 'student',
            ]);
        }
    }
public function run ( ) { DB :: table ( 'users' ) -> insert ( [ 'name' => 'Admin' , 'email' => 'admin@gmail.com' , 'password' => Hash :: make ( 'secret' ) , 'role' => 'admin' ] ) ; for ( $ i = 0 ; $ i < 20 ; $ i ++ ) { DB :: table ( 'users' ) -> insert ( [ 'name' => Str :: random ( 10 ) , 'email' => Str :: random ( 10 ) . '@gmail.com' , 'password' => Hash :: make ( 'password' ) , 'role' => 'student' , ] ) ; } }
Run the database seeds.
Run the database seeds .