You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 More fixes 🆙
This commit is contained in:
@@ -14,7 +14,7 @@ use Illuminate\View\View;
|
||||
|
||||
class WebsiteRareValuesController extends Controller
|
||||
{
|
||||
public function __construct(private readonly RareValueCategoriesService $valueCategoriesService): void {}
|
||||
public function __construct(private readonly RareValueCategoriesService $valueCategoriesService) {}
|
||||
|
||||
public function index(): View
|
||||
{
|
||||
@@ -42,7 +42,7 @@ class WebsiteRareValuesController extends Controller
|
||||
|
||||
public function search(RareSearchFormRequest $request): View|RedirectResponse
|
||||
{
|
||||
$searchTerm = $request->input('search');
|
||||
$searchTerm = $request->string('search')->toString();
|
||||
|
||||
$categories = $this->valueCategoriesService->searchCategories($searchTerm);
|
||||
|
||||
@@ -64,13 +64,18 @@ class WebsiteRareValuesController extends Controller
|
||||
->where('item_id', $value->item_id)
|
||||
->get();
|
||||
|
||||
$itemsPerUser = $items->groupBy('user_id')->map(fn ($group) => [
|
||||
'user' => $group->first()->user,
|
||||
'item_count' => $group->count(),
|
||||
]);
|
||||
$itemsPerUser = $items->groupBy('user_id')->map(function ($group) {
|
||||
/** @var \App\Models\Game\Furniture\Item $firstItem */
|
||||
$firstItem = $group->first();
|
||||
|
||||
return [
|
||||
'user' => $firstItem->user,
|
||||
'item_count' => $group->count(),
|
||||
];
|
||||
});
|
||||
|
||||
if ((bool) setting('enable_caching')) {
|
||||
Cache::remember('allItems_' . $value->id, setting('cache_timer'), fn () => $items);
|
||||
Cache::remember('allItems_' . $value->id, (int) setting('cache_timer'), fn () => $items);
|
||||
}
|
||||
|
||||
return view('value', [
|
||||
|
||||
Reference in New Issue
Block a user