Start working on sorting products by different columns.

This commit is contained in:
Krzysztof Płaczek
2025-01-27 12:10:15 +01:00
parent a26ad401df
commit 9b6bcd22be
5 changed files with 25 additions and 8 deletions

View File

@@ -13,7 +13,6 @@ final class SearchController extends BaseController
public function __invoke(Request $request): Response
{
$search = $request->query->get('search');
//dd();
$products = Product::with('price')
->orWhere([['name', 'like', "%$search%"]])
->orWhere([['subTitle', 'like', "%$search%"]])->get();