feat: add notes management feature with CRUD operations

- Created Note model and controller for handling notes.
- Added routes for notes CRUD operations.
- Implemented notes index view with search and pinning functionality.
- Created migration for notes table with necessary fields.
- Developed event creation form with client and contract options.
This commit is contained in:
I-Fun
2026-04-02 23:24:38 +07:00
parent 5748b163b6
commit 1b90f730a6
25 changed files with 1524 additions and 390 deletions

View File

@@ -15,45 +15,50 @@
@endif
{{-- Add form --}}
<div class="cat-card overflow-hidden">
<div class="cat-card overflow-hidden" x-data="{ open: {{ $errors->any() ? 'true' : 'false' }} }">
<div class="flex items-center gap-3 px-5 py-4 border-b border-pink-50">
<span class="text-xl">➕</span>
<h2 class="font-bold text-gray-700">Add New Category</h2>
<button type="button" @click="open = !open"
class="btn-sakura text-xs"
x-text="open ? '✕ Close' : '+ Add New Category'">
</button>
</div>
<form action="{{ route('client-categories.store') }}" method="POST"
class="p-5 grid grid-cols-2 sm:grid-cols-4 gap-3 items-end">
@csrf
<div>
<label class="block text-xs font-semibold text-gray-600 mb-1">Name <span class="text-pink-400">*</span></label>
<input type="text" name="name" required maxlength="100"
placeholder="e.g. Energy Drinks"
class="input-soft" value="{{ old('name') }}">
</div>
<div>
<label class="block text-xs font-semibold text-gray-600 mb-1">Parent (optional)</label>
<select name="parent_id" class="input-soft">
<option value="">— Root category —</option>
@foreach($parents as $p)
<option value="{{ $p->id }}" {{ old('parent_id') == $p->id ? 'selected' : '' }}>
{{ $p->icon }} {{ $p->name }}
</option>
@endforeach
</select>
</div>
<div>
<label class="block text-xs font-semibold text-gray-600 mb-1">Icon (emoji)</label>
<input type="text" name="icon" maxlength="10" placeholder="🏷️"
class="input-soft" value="{{ old('icon') }}">
</div>
<div class="flex items-end gap-2">
<div class="flex-1">
<label class="block text-xs font-semibold text-gray-600 mb-1">Color</label>
<input type="color" name="color" value="{{ old('color', '#FFB7C5') }}"
class="w-full h-[42px] rounded-2xl border border-pink-200 cursor-pointer p-1 bg-white">
<div x-show="open" x-transition style="display:none">
<form action="{{ route('client-categories.store') }}" method="POST"
class="p-5 grid grid-cols-2 sm:grid-cols-4 gap-3 items-end border-b border-pink-50">
@csrf
<div>
<label class="block text-xs font-semibold text-gray-600 mb-1">Name <span class="text-pink-400">*</span></label>
<input type="text" name="name" required maxlength="100"
placeholder="e.g. Energy Drinks"
class="input-soft" value="{{ old('name') }}">
</div>
<button type="submit" class="btn-sakura px-4 py-2.5 shrink-0 text-sm">Add</button>
</div>
</form>
<div>
<label class="block text-xs font-semibold text-gray-600 mb-1">Parent (optional)</label>
<select name="parent_id" class="input-soft">
<option value="">— Root category —</option>
@foreach($parents as $p)
<option value="{{ $p->id }}" {{ old('parent_id') == $p->id ? 'selected' : '' }}>
{{ $p->icon }} {{ $p->name }}
</option>
@endforeach
</select>
</div>
<div>
<label class="block text-xs font-semibold text-gray-600 mb-1">Icon (emoji)</label>
<input type="text" name="icon" maxlength="10" placeholder="🏷️"
class="input-soft" value="{{ old('icon') }}">
</div>
<div class="flex items-end gap-2">
<div class="flex-1">
<label class="block text-xs font-semibold text-gray-600 mb-1">Color</label>
<input type="color" name="color" value="{{ old('color', '#FFB7C5') }}"
class="w-full h-[42px] rounded-2xl border border-pink-200 cursor-pointer p-1 bg-white">
</div>
<button type="submit" class="btn-sakura px-4 py-2.5 shrink-0 text-sm">Add</button>
</div>
</form>
</div>
</div>
{{-- List --}}
@@ -66,6 +71,7 @@
</span>
</div>
@php $roots = $categories->whereNull('parent_id'); @endphp
@forelse($roots as $root)