@section('title', 'Department')
{{ __('Create New Department') }}
{!! Form::model($department, [ 'url' => $department->exists ? route('backend.department.update', $department->id) : route('backend.department.store'), 'method' => $department->exists ? 'PUT' : 'POST', 'id' => $department->exists ? 'departmentUpdate' : 'departmentCreate', ]) !!}
{!! Form::label('name', 'Department Name', ['class' => 'form-label']) !!} * {!! Form::text('name', null, ['class' => 'form-control']) !!}
{!! Form::label('name', 'Branch Name', ['class' => 'form-label']) !!} * {!! Form::select( 'branch_id', ['' => 'Select Branch'] + $branches->pluck('name', 'id')->toArray(), old('branch_id', $department->branch_id), [ 'class' => 'form-control form-select select2', 'id' => 'branch', ], ) !!}
{!! Form::label('country', 'Country', ['class' => 'form-label']) !!} {!! Form::text('country', old('country', optional($department->country)->name), [ 'class' => 'form-control', 'id' => 'country', 'readonly' => 'true', ]) !!}
{!! Form::label('city', 'City', ['class' => 'form-label']) !!} {!! Form::text('city', old('country', optional($department->city)->name), [ 'class' => 'form-control', 'id' => 'city', 'readonly' => 'true', ]) !!}
{!! Form::submit($department->exists ? 'Update' : 'Create', ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!}
@push('js') {{-- Load branch with country & city --}} @endpush