select(['id', 'name', 'phone_number', 'address']) ->when($search, fn ($q) => $q->where('name', 'like', "%{$search}%")) ->orderBy($sort, $direction) ->paginate($perPage); } public function getAll(): Collection { return Customer::select(['id', 'name'])->orderBy('name')->get(); } public function store(array $data): Customer { return Customer::create($data); } public function update(Customer $customer, array $data): Customer { $customer->update($data); return $customer; } public function destroy(Customer $customer): bool { return $customer->delete(); } }