mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 11:14:06 +00:00
1.8 - Factory States
This commit is contained in:
@@ -39,3 +39,15 @@ $factory->define(App\Concert::class, function (Faker\Generator $faker) {
|
||||
'additional_information' => 'Some sample additional information.',
|
||||
];
|
||||
});
|
||||
|
||||
$factory->state(App\Concert::class, 'published', function ($faker) {
|
||||
return [
|
||||
'published_at' => Carbon::parse('-1 week'),
|
||||
];
|
||||
});
|
||||
|
||||
$factory->state(App\Concert::class, 'unpublished', function ($faker) {
|
||||
return [
|
||||
'published_at' => null,
|
||||
];
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user