From 15c32209b2ba6fefd230e40589ec2c7aee9d15a0 Mon Sep 17 00:00:00 2001 From: Lukas Halbritter Date: Wed, 12 Sep 2018 11:56:28 +0200 Subject: [PATCH] Added model factories for the remaining models. --- database/factories/BookingFactory.php | 12 ++++++++++++ database/factories/PersonTargetFactory.php | 9 +++++++++ database/factories/ProjectFactory.php | 13 +++++++++++++ database/factories/SubBookingFactory.php | 9 +++++++++ 4 files changed, 43 insertions(+) create mode 100644 database/factories/BookingFactory.php create mode 100644 database/factories/PersonTargetFactory.php create mode 100644 database/factories/ProjectFactory.php create mode 100644 database/factories/SubBookingFactory.php diff --git a/database/factories/BookingFactory.php b/database/factories/BookingFactory.php new file mode 100644 index 0000000..683bb47 --- /dev/null +++ b/database/factories/BookingFactory.php @@ -0,0 +1,12 @@ +define(App\Booking::class, function (Faker $faker) { + return [ + 'date'=> $faker->dateTimeBetween('2014-01-01'), + 'reference' => $faker->text(50), + 'person_or_company' => $faker->name, + 'note' => $faker->text(10) + ]; +}); diff --git a/database/factories/PersonTargetFactory.php b/database/factories/PersonTargetFactory.php new file mode 100644 index 0000000..339fcc5 --- /dev/null +++ b/database/factories/PersonTargetFactory.php @@ -0,0 +1,9 @@ +define(App\PersonTarget::class, function (Faker $faker) { + return [ + // + ]; +}); diff --git a/database/factories/ProjectFactory.php b/database/factories/ProjectFactory.php new file mode 100644 index 0000000..fb24f77 --- /dev/null +++ b/database/factories/ProjectFactory.php @@ -0,0 +1,13 @@ +define(App\Project::class, function (Faker $faker) { + $start_date = $faker->dateTimeBetween('2014-01-01'); + + return [ + 'name' => 'Project ' . $faker->word() . ' ' . $start_date->format('Y'), + 'start_date' => $start_date, + 'end_date' => $faker->dateTimeInInterval($start_date, '+ 26 weeks') + ]; +}); diff --git a/database/factories/SubBookingFactory.php b/database/factories/SubBookingFactory.php new file mode 100644 index 0000000..c6385c1 --- /dev/null +++ b/database/factories/SubBookingFactory.php @@ -0,0 +1,9 @@ +define(App\SubBooking::class, function (Faker $faker) { + return [ + '' + ]; +});