database/seeders/UserSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $admin = User::create([
            'name' => 'Admin',
            'email' => 'admin@test.com',
            'password' => Hash::make('123456'),
        ]);
        $role = Role::where('name', 'Admin')->first();
        $admin->assignRole([$role->id]);
        $po = User::create([
            'name' => 'po',
            'email' => 'po@test.com',
            'password' => Hash::make('123456'),
        ]);
        $role = Role::where('name', 'PassOffice')->first();
        $po->assignRole([$role->id]);
    }
public function run ( ) { $ admin = User :: create ( [ 'name' => 'Admin' , 'email' => 'admin@test.com' , 'password' => Hash :: make ( '123456' ) , ] ) ; $ role = Role :: where ( 'name' , 'Admin' ) -> first ( ) ; $ admin -> assignRole ( [ $ role -> id ] ) ; $ po = User :: create ( [ 'name' => 'po' , 'email' => 'po@test.com' , 'password' => Hash :: make ( '123456' ) , ] ) ; $ role = Role :: where ( 'name' , 'PassOffice' ) -> first ( ) ; $ po -> assignRole ( [ $ role -> id ] ) ; }
Run the database seeds.
Run the database seeds .