From c66e3422e46565b2ace91d2d2688fae4a593386c Mon Sep 17 00:00:00 2001 From: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> Date: Sun, 2 Jun 2024 20:23:32 +0100 Subject: [PATCH] Code refactor Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> --- src/Models/Concerns/HasWorkingHours.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Models/Concerns/HasWorkingHours.php b/src/Models/Concerns/HasWorkingHours.php index 4719181..fd5c2c7 100644 --- a/src/Models/Concerns/HasWorkingHours.php +++ b/src/Models/Concerns/HasWorkingHours.php @@ -7,6 +7,7 @@ use Igniter\Local\Classes\ScheduleItem; use Igniter\Local\Classes\WorkingSchedule; use Igniter\Local\Events\WorkingScheduleCreatedEvent; +use Igniter\Local\Exceptions\WorkingHourException; use Illuminate\Database\Eloquent\RelationNotFoundException; use Illuminate\Support\Collection; use InvalidArgumentException; @@ -87,7 +88,7 @@ public function newWorkingSchedule($type, $days = null) { $types = $this->availableWorkingTypes(); if (is_null($type) || !in_array($type, $types)) { - throw new InvalidArgumentException(sprintf(lang('igniter.local::default.alert_invalid_schedule_type'), $type)); + throw new WorkingHourException(sprintf(lang('igniter.local::default.alert_invalid_schedule_type'), $type)); } if (is_null($days)) {