Skip to content

Commit

Permalink
Set term in past just 1 month before now
Browse files Browse the repository at this point in the history
  • Loading branch information
arxeiss committed Apr 24, 2023
1 parent 8811538 commit e8a5fee
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions database/seeds/TestDataSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function run()
$admin = User::where(['role' => 'admin'])->orderBy('created_at')->first();

if ($master == null || $admin == null) {
throw new \Exception("Cannot find user with 'master' and 'admin' role");
throw new \Exception("Cannot find user with 'master' and 'admin' role");
}

$parent1 = User::create([
Expand Down Expand Up @@ -119,11 +119,12 @@ public function run()
]);

// Terms
$pastStart = Carbon::now()->subMonths(1)->next(Carbon::MONDAY);
$termInPast = Term::create([
'category_id' => $categoryJS->id,
'start' => new Carbon('2021-01-11'),
'end' => new Carbon('2021-01-15'),
'opening' => new Carbon('2020-12-01T15:00:00+01:00'),
'start' => new $pastStart,
'end' => $pastStart->clone()->next(Carbon::FRIDAY),
'opening' => $pastStart->clone()->subMonths(3),
'price' => 2500,
]);

Expand Down

0 comments on commit e8a5fee

Please sign in to comment.