database/seeds/UserSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run(Faker $faker)
    {
        for ($i=0; $i < 10; $i++) { 
            $newUser = new User();
            $newUser->name = $faker->name();
            $newUser->email = $faker->email();
            $string = '12345678';
            $newUser->password = Hash::make($string);
            $newUser->save();
        }
    }
public function run ( Faker $ faker ) { for ( $ i = 0 ; $ i < 10 ; $ i ++ ) { $ newUser = new User ( ) ; $ newUser -> name = $ faker -> name ( ) ; $ newUser -> email = $ faker -> email ( ) ; $ string = '12345678' ; $ newUser -> password = Hash :: make ( $ string ) ; $ newUser -> save ( ) ; } }
Run the database seeds.
Run the database seeds .
//stringa per password fake //che poi viene criptata da Hash::make