Add currency_id to User model's factory and use factories for UsersTableSeeder
MODIFY
database/factories/ModelFactory.php
database/factories/ModelFactory.php
@@ -7,6 +7,7 @@ use App\Spending;
$factory->define(User::class, function (Generator $faker) {
return [
+ 'currency_id' => $faker->numberBetween(1, 3),
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret

MODIFY
database/seeds/UsersTableSeeder.php
database/seeds/UsersTableSeeder.php
@@ -6,11 +6,6 @@ use App\User;
class UsersTableSeeder extends Seeder {
public function run() {
- User::create([
- 'currency_id' => 1,
- 'name' => 'Sjaak',
- 'email' => 'sjaak@blaaskaak.com',
- 'password' => Hash::make('sjaak123')
- ]);
+ factory(User::class, 5)->create();
}
}

Add currency_id to User model's factory and use factories for UsersTableSeeder