Skip to content

Commit

Permalink
Code refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Jul 2, 2024
1 parent 574ade5 commit 9632a95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Database/Factories/ReservationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Igniter\Reservation\Database\Factories;

use Igniter\Flame\Database\Factories\Factory;
use Igniter\Local\Models\Location;

class ReservationFactory extends Factory
{
Expand All @@ -18,6 +19,7 @@ public function definition(): array
'reserve_date' => $this->faker->date(),
'reserve_time' => $this->faker->time(),
'guest_num' => $this->faker->numberBetween(0, 99),
'location_id' => Location::factory(),
];
}
}
2 changes: 1 addition & 1 deletion src/Models/Reservation.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public function isCancelable()
return false;
}

return $this->reservation_datetime->diffInRealMinutes() > $timeout;
return now()->diffInRealMinutes($this->reservation_datetime) > $timeout;

Check failure on line 202 in src/Models/Reservation.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 - Static Analysis

Call to an undefined method Illuminate\Support\Carbon::diffInRealMinutes().

Check failure on line 202 in src/Models/Reservation.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 - Static Analysis

Call to an undefined method Illuminate\Support\Carbon::diffInRealMinutes().
}

public function markAsCanceled(array $statusData = [])
Expand Down

0 comments on commit 9632a95

Please sign in to comment.