feat: add quick-create functionality for client categories in the schedule form

This commit is contained in:
I-Fun
2026-04-04 22:40:20 +07:00
parent 15c8d3ae7c
commit 79f2f22e5d
8 changed files with 320 additions and 131 deletions

View File

@@ -34,11 +34,12 @@ class BrandContract extends Model
// ── Scopes ───────────────────────────────────────────────────
public function scopeActive($query)
public function scopeActive($query, $date = null)
{
$date = $date ?? today();
return $query->where('is_active', true)
->where('start_date', '<=', today())
->where('end_date', '>=', today());
->where('start_date', '<=', $date)
->where('end_date', '>=', $date);
}
// ── Helpers ──────────────────────────────────────────────────