@extends('adminlte::page') @section('title', 'Edit User') @section('content_header')

Edit {{ $user->name }}

@stop @section('content')
@if (session()->has('success'))
{!! session()->get('success') !!}
@endif @if (count($errors) > 0)
Whoops! There were some problems with your input.
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@csrf @method('PATCH')
@error('name') {{ $message }} @enderror
@error('email') {{ $message }} @enderror
@error('phone') {{ $message }} @enderror
@error('password') {{ $message }} @enderror
@error('password_confirmation') {{ $message }} @enderror
@error('roles') {{ $message }} @enderror
{{-- Hidden field to ensure "0" is submitted if checkbox is unchecked --}} {{-- Actual checkbox --}} status) ? 'checked' : '' }}>
employee == true) checked @endif>

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
@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
{{--
--}}
@stop @section('css') @stop @section('js') @stop