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()
    {
        $admin =            Role::where('name', 'admin')->first();
        $inversionista =         Role::where('name', 'inversionista')->first();
      $user = User::create([
        'name' => 'Tony',
        'apellidos'=>'Stark',
        'username'=>'admin',
        'email'=>'admin@softdepot.mx',
        'password'=>bcrypt('12345678'),
        'status'=>true,
        'id_estado'=>rand(1, 32),
        'id_ciudad'=>rand(1,2492)
      ]);
      $user->roles()->attach($admin);
            $user = User::create([
        'name' => 'Jhoan',
        'apellidos'=>'Borges',
        'username'=>'jhoan.borges',
        'email'=>'beta.tester.jhoan@gmail.com',
        'password'=>bcrypt('12345678'),
        'status'=>true,
        'id_estado'=>19,
        'id_ciudad'=>986,
      ]);
      $user->roles()->attach($inversionista);
    }
public function run ( ) { $ admin = Role :: where ( 'name' , 'admin' ) -> first ( ) ; $ inversionista = Role :: where ( 'name' , 'inversionista' ) -> first ( ) ; $ user = User :: create ( [ 'name' => 'Tony' , 'apellidos' => 'Stark' , 'username' => 'admin' , 'email' => 'admin@softdepot.mx' , 'password' => bcrypt ( '12345678' ) , 'status' => true , 'id_estado' => rand ( 1 , 32 ) , 'id_ciudad' => rand ( 1 , 2492 ) ] ) ; $ user -> roles ( ) -> attach ( $ admin ) ; $ user = User :: create ( [ 'name' => 'Jhoan' , 'apellidos' => 'Borges' , 'username' => 'jhoan.borges' , 'email' => 'beta.tester.jhoan@gmail.com' , 'password' => bcrypt ( '12345678' ) , 'status' => true , 'id_estado' => 19 , 'id_ciudad' => 986 , ] ) ; $ user -> roles ( ) -> attach ( $ inversionista ) ; }
Run the database seeds.
Run the database seeds .
//tipo 1 //'tipo_usuario'=>1,