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 Jun 2, 2024
1 parent 8667748 commit c66e342
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Models/Concerns/HasWorkingHours.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit c66e342

Please sign in to comment.