feat: enhance search functionality in RawMaterialService for improved filtering of raw materials
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (8.3) (push) Waiting to run
tests / ci (8.4) (push) Waiting to run
tests / ci (8.5) (push) Waiting to run

This commit is contained in:
Yoga Pangestu 2026-07-07 10:48:01 +07:00
parent dc594c9daa
commit 1c7fc17531

View File

@ -37,7 +37,10 @@ public function paginateForIndex(array $tableQuery, string $isActive, string $st
'pendingOwnerVerificationRequest.submittedBy.profile', 'pendingOwnerVerificationRequest.submittedBy.profile',
'prices' => fn ($query) => $query 'prices' => fn ($query) => $query
->orderBy('created_at') ->orderBy('created_at')
->with('media'), ->with('media')
->when($tableQuery['search'] !== '', function ($query) use ($tableQuery): void {
$query->where('variant', 'like', "%{$tableQuery['search']}%");
}),
]) ])
->when($tableQuery['search'] !== '', function (Builder $query) use ($tableQuery): void { ->when($tableQuery['search'] !== '', function (Builder $query) use ($tableQuery): void {
$search = $tableQuery['search']; $search = $tableQuery['search'];