database/seeds/DatabaseSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        factory(User::class)->create(
            [
                'name' => 'welliton',
                'email' => 'welliton.fokushima@gmail.com',
                'password' => bcrypt(123456), 
                'remember_token' => str_random(10),
            ]
        );
        DB::statement('SET FOREIGN_KEY_CHECKS=0;');
         $this->call(PostsTableSeeder::class);
         $this->call(TagTableSeeder::class);
        DB::statement('SET FOREIGN_KEY_CHECKS=1;');
    }
public function run ( ) { factory ( User :: class ) -> create ( [ 'name' => 'welliton' , 'email' => 'welliton.fokushima@gmail.com' , 'password' => bcrypt ( 123456 ) , 'remember_token' => str_random ( 10 ) , ] ) ; DB :: statement ( 'SET FOREIGN_KEY_CHECKS=0;' ) ; $ this -> call ( PostsTableSeeder :: class ) ; $ this -> call ( TagTableSeeder :: class ) ; DB :: statement ( 'SET FOREIGN_KEY_CHECKS=1;' ) ; }
Run the database seeds.
Run the database seeds .
// secret //disable foreign key check for this connection before running seeders // supposed to only apply to a single connection and reset it's self