@php
    $record = $record ?? null;
@endphp
<div class="mb-3">
    <label class="form-label">Name</label>
    <input type="text" name="name" class="form-control @error('name') is-invalid @enderror" value="{{ old('name', $record->name ?? '') }}" required>
    @error('name')
        <div class="invalid-feedback">{{ $message }}</div>
    @enderror
</div>
<div class="mb-3">
    <div class="form-check custom-checkbox">
        <input type="hidden" name="is_active" value="0">
        <input type="checkbox" name="is_active" value="1" class="form-check-input" id="is_active" @checked(filter_var(old('is_active', $record->is_active ?? true), FILTER_VALIDATE_BOOLEAN))>
        <label class="form-check-label" for="is_active">Active</label>
    </div>
</div>
