Add factory for Recurring model
MODIFY
database/factories/ModelFactory.php
database/factories/ModelFactory.php
@@ -6,6 +6,7 @@ use App\Space;
use App\Tag;
use App\Earning;
use App\Spending;
+use App\Recurring;
$factory->define(User::class, function (Generator $faker) {
return [
@@ -44,3 +45,13 @@ $factory->define(Spending::class, function (Generator $faker) {
'amount' => $faker->randomNumber(3)
];
});
+
+$factory->define(Recurring::class, function (Generator $faker) {
+ return [
+ 'type' => 'monthly',
+ 'day' => numberBetween(1, 28),
+ 'starts_on' => $faker->dateTimeBetween('-50 days', 'now')->format('Y-m-d'),
+ 'description' => implode(' ', array_map('ucfirst', $faker->words(3))),
+ 'amount' => $faker->randomNumber(3)
+ ];
+});

Add factory for Recurring model