database/seeders/UserTableSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $user = User::create([
            'name' => 'Administrator', 
            'email' => 'admin@gmail.com',
            'password' => FacadesHash::make('12345678'),
            'alamat' => 'Indramayu' ,
            'telepon' => '082314567782',
            'foto' => 'avatar.jpg'
        ]);
        $role = Role::find(1);
        $permissions = Permission::pluck('id', 'id')->all();
        $role->syncPermissions($permissions);
        $user->assignRole([$role->id]);
    }
public function run ( ) { $ user = User :: create ( [ 'name' => 'Administrator' , 'email' => 'admin@gmail.com' , 'password' => FacadesHash :: make ( '12345678' ) , 'alamat' => 'Indramayu' , 'telepon' => '082314567782' , 'foto' => 'avatar.jpg' ] ) ; $ role = Role :: find ( 1 ) ; $ permissions = Permission :: pluck ( 'id' , 'id' ) -> all ( ) ; $ role -> syncPermissions ( $ permissions ) ; $ user -> assignRole ( [ $ role -> id ] ) ; }
Run the database seeds.
Run the database seeds .