database/seeds/UserTablaSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $user = new User();
        $user->name='David';
        $user->email='email3@gmail.com';
        $user->password=Hash::make('12345678');
        $user->save();
        $user->roles()->attach(Role::where('name', 'Super Administrador')->get()->first());
        $user = new User();
        $user->name='Henry';
        $user->email='email2@gmail.com';
        $user->password=Hash::make('12345678');
        $user->save();
        $user->roles()->attach(Role::where('name', 'Panadero')->get()->first());
        $user = new User();
        $user->name='Yohana';
        $user->email='email1@gmail.com';
        $user->password=Hash::make('12345678');
        $user->save();
        $user->roles()->attach(Role::where('name', 'Auxiliar')->get()->first());
    }
public function run ( ) { $ user = new User ( ) ; $ user -> name = 'David' ; $ user -> email = 'email3@gmail.com' ; $ user -> password = Hash :: make ( '12345678' ) ; $ user -> save ( ) ; $ user -> roles ( ) -> attach ( Role :: where ( 'name' , 'Super Administrador' ) -> get ( ) -> first ( ) ) ; $ user = new User ( ) ; $ user -> name = 'Henry' ; $ user -> email = 'email2@gmail.com' ; $ user -> password = Hash :: make ( '12345678' ) ; $ user -> save ( ) ; $ user -> roles ( ) -> attach ( Role :: where ( 'name' , 'Panadero' ) -> get ( ) -> first ( ) ) ; $ user = new User ( ) ; $ user -> name = 'Yohana' ; $ user -> email = 'email1@gmail.com' ; $ user -> password = Hash :: make ( '12345678' ) ; $ user -> save ( ) ; $ user -> roles ( ) -> attach ( Role :: where ( 'name' , 'Auxiliar' ) -> get ( ) -> first ( ) ) ; }
Run the database seeds.
Run the database seeds .
//