121 - Custom Factory Classes

This commit is contained in:
Adam Wathan
2017-07-04 11:22:41 -04:00
parent a59e0e21a2
commit c36865a84a
4 changed files with 29 additions and 26 deletions

View File

@@ -18,10 +18,11 @@ class DatabaseSeeder extends Seeder
'password' => bcrypt('secret'),
]);
factory(App\Concert::class)->states('published')->create([
\ConcertFactory::createPublished([
'user_id' => $user->id,
'title' => "The Red Chord",
'subtitle' => "with Animosity and Lethargy",
'additional_information' => "This concert is 19+.",
'venue' => "The Mosh Pit",
'venue_address' => "123 Example Lane",
'city' => "Laraville",
@@ -29,13 +30,14 @@ class DatabaseSeeder extends Seeder
'zip' => "17916",
'date' => Carbon::parse('2017-09-13 8:00pm'),
'ticket_price' => 3250,
'additional_information' => "This concert is 19+.",
])->addTickets(10);
'ticket_quantity' => 10,
]);
factory(App\Concert::class)->create([
'user_id' => $user->id,
'title' => "Slayer",
'subtitle' => "with Forbidden and Testament",
'additional_information' => null,
'venue' => "The Rock Pile",
'venue_address' => "55 Sample Blvd",
'city' => "Laraville",
@@ -43,7 +45,7 @@ class DatabaseSeeder extends Seeder
'zip' => "19276",
'date' => Carbon::parse('2017-10-05 7:00pm'),
'ticket_price' => 5500,
'additional_information' => null,
])->addTickets(10);
'ticket_quantity' => 10,
]);
}
}