diff --git a/src/Database/Factories/ReservationFactory.php b/src/Database/Factories/ReservationFactory.php index ce542f1..69a2fe3 100644 --- a/src/Database/Factories/ReservationFactory.php +++ b/src/Database/Factories/ReservationFactory.php @@ -3,6 +3,7 @@ namespace Igniter\Reservation\Database\Factories; use Igniter\Flame\Database\Factories\Factory; +use Igniter\Local\Models\Location; class ReservationFactory extends Factory { @@ -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(), ]; } } diff --git a/src/Models/Reservation.php b/src/Models/Reservation.php index 2762a6f..ccdf62e 100644 --- a/src/Models/Reservation.php +++ b/src/Models/Reservation.php @@ -199,7 +199,7 @@ public function isCancelable() return false; } - return $this->reservation_datetime->diffInRealMinutes() > $timeout; + return now()->diffInRealMinutes($this->reservation_datetime) > $timeout; } public function markAsCanceled(array $statusData = [])