Only For Employees

Fill these details if adding an employee only
Link employees to services they are assigned to @error('service') {{ $message }} @enderror
Create booking slots based on your preferred time duration. @error('slot_duration') {{ $message }} @enderror
Break between one to another appointment @error('break_duration') {{ $message }} @enderror

Set Availability - For Employee

Select days and timings, with the option to add multiple time slots in a day, e.g., 9 AM–12 PM and 4 PM–8 PM.
@foreach ($days as $day)
From:
To:
Add More
@if (old('days.' . $day) || isset($employeeDays[$day])) @foreach (old('days.' . $day) ?: $employeeDays[$day] as $index => $time) @if ($index > 1 && $index % 2 == 0)
From:
To
Remove
@endif @endforeach @endif @endforeach

{{--

Add Holidays

No need to add time for a full day; for part-time work, specify the day and time.

Add Holiday
--}} {{--

Add Holidays

No need to add time for a full day; for part-time work, specify the day and time.

Add Holiday
@if (is_array(old('holidays.date'))) @foreach (old('holidays.date') as $index => $date)
From:
To:
Remove
@endforeach @endif
--}} {{--

Add Holidays

No need to add time for a full day; for part-time work, specify the day and time.

Add Holiday
@if ($user->employee && $user->employee->holidays->isNotEmpty()) @foreach ($user->employee->holidays as $index => $holiday) @php // Access the hours array directly $timeRange = $holiday->hours; $fromTime = isset($timeRange[0]) ? explode('-', $timeRange[0])[0] : ''; $toTime = isset($timeRange[0]) ? explode('-', $timeRange[0])[1] : ''; @endphp
From:
To:
Remove
recurring ? 'checked' : '' }}>
@endforeach @else

No holidays found for this user.

@endif
--}} {{--

Add Holidays

No need to add time for a full day; for part-time work, specify the day and time.

Add Holiday
@if ($user->employee && $user->employee->holidays->isNotEmpty()) @foreach ($user->employee->holidays as $index => $holiday) @php $fromTime = ''; $toTime = ''; if (!empty($holiday->hours) && is_array($holiday->hours)) { $timeRange = explode('-', $holiday->hours[0] ?? ''); $fromTime = $timeRange[0] ?? ''; $toTime = $timeRange[1] ?? ''; } @endphp
From:
To:
Remove
@endforeach @else

No holidays found for this user. Click "Add Holiday" to create one.

@endif
--}} {{--

Add Holidays

No need to add time for a full day; for part-time work, specify the day and time.

Add Holiday
@forelse(old('holidays.date', $user->employee->holidays ?? []) as $index => $date) @php $holiday = $user->employee->holidays[$index] ?? null; $fromTime = old("holidays.from_time.$index", $holiday && $holiday->hours ? explode('-', $holiday->hours[0])[0] ?? '' : ''); $toTime = old("holidays.to_time.$index", $holiday && $holiday->hours ? explode('-', $holiday->hours[0])[1] ?? '' : ''); $recurring = old("holidays.recurring.$index", $holiday->recurring ?? 0); @endphp
From:
To:
Remove
@empty

No holidays found for this user. Click "Add Holiday" to create one.

@endforelse
--}}

Add Holidays

No need to add time for a full day; for part-time work, specify the day and time.

Add Holiday
@php // Get holidays from old input or database $holidaysInput = old('holidays.date', []); $dbHolidays = $user->employee->holidays ?? []; $holidaysToDisplay = !empty($holidaysInput) ? $holidaysInput : $dbHolidays; @endphp @forelse($holidaysToDisplay as $index => $holidayItem) @php // Determine if we're using old input or database data $usingOldInput = !empty($holidaysInput); if ($usingOldInput) { $date = old("holidays.date.$index"); $holiday = null; } else { $holiday = $holidayItem; $date = $holiday->date; // Format date for input field if it's not already in YYYY-MM-DD format if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $date)) { try { $date = \Carbon\Carbon::parse($date)->format('Y-m-d'); } catch (Exception $e) { $date = ''; } } } $fromTime = old("holidays.from_time.$index", $holiday && $holiday->hours ? explode('-', $holiday->hours[0])[0] ?? '' : ''); $toTime = old("holidays.to_time.$index", $holiday && $holiday->hours ? explode('-', $holiday->hours[0])[1] ?? '' : ''); $recurring = old("holidays.recurring.$index", $holiday->recurring ?? 0); @endphp
From:
To:
Remove
@empty

No holidays found for this user. Click "Add Holiday" to create one.

@endforelse