(update database seeder)

This commit is contained in:
Adam Wathan
2017-07-04 10:01:28 -04:00
parent 2588b5e2fb
commit 39adf532fb

View File

@@ -13,12 +13,13 @@ class DatabaseSeeder extends Seeder
*/ */
public function run() public function run()
{ {
factory(App\User::class)->create([ $user = factory(App\User::class)->create([
'email' => "adam@example.com", 'email' => "adam@example.com",
'password' => bcrypt('secret'), 'password' => bcrypt('secret'),
]); ]);
factory(App\Concert::class)->states('published')->create([ factory(App\Concert::class)->states('published')->create([
'user_id' => $user->id,
'title' => "The Red Chord", 'title' => "The Red Chord",
'subtitle' => "with Animosity and Lethargy", 'subtitle' => "with Animosity and Lethargy",
'venue' => "The Mosh Pit", 'venue' => "The Mosh Pit",
@@ -26,9 +27,23 @@ class DatabaseSeeder extends Seeder
'city' => "Laraville", 'city' => "Laraville",
'state' => "ON", 'state' => "ON",
'zip' => "17916", 'zip' => "17916",
'date' => Carbon::parse('2016-12-13 8:00pm'), 'date' => Carbon::parse('2017-09-13 8:00pm'),
'ticket_price' => 3250, 'ticket_price' => 3250,
'additional_information' => "This concert is 19+.", 'additional_information' => "This concert is 19+.",
])->addTickets(10); ])->addTickets(10);
factory(App\Concert::class)->create([
'user_id' => $user->id,
'title' => "Slayer",
'subtitle' => "with Forbidden and Testament",
'venue' => "The Rock Pile",
'venue_address' => "55 Sample Blvd",
'city' => "Laraville",
'state' => "ON",
'zip' => "19276",
'date' => Carbon::parse('2017-10-05 7:00pm'),
'ticket_price' => 5500,
'additional_information' => null,
])->addTickets(10);
} }
} }