@extends('home.user_shops.layout')
@section('home.user_shops-title')
User Shop Search
@endsection
@section('home.user_shops-content')
{!! breadcrumbs(['User Shops' => 'user-shops/shop-index', 'Item Search' => 'user-shops/item-search']) !!}
User Shop Item Search
Select an item that you are looking to buy from other users, and you will be able to see if any shops are currently stocking it, as well as the cost of each user's items.
Items that are not currently stocked by any shops will not be shown.
Selecting a category will limit the search to only items in that category, unless they have been specifically added to the search.
{!! Form::open(['method' => 'GET', 'class' => '']) !!}
{!! Form::select('item_ids[]', $items, Request::get('item_ids'), [
'id' => 'itemList',
'class' => 'form-control',
'placeholder' => 'Select Items',
'style' => 'width: 25em; max-width: 100%;',
'multiple',
]) !!}
{!! Form::select('item_category_id', $categories, Request::get('item_category_id'), ['class' => 'form-control', 'placeholder' => 'Search by Category']) !!}
{!! Form::submit('Search', ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!}
@if ($searched_items)
Search Results
Searching for: {!! $searched_items->pluck('name')->implode(', ') !!}
@if ($category)
Category: {!! $category->displayName !!}
Note that items listed also include items from the chosen category.
@endif
@if (count($shopItems) && $shopItems->pluck('quantity')->count() > 0)
Item
Shop
Shop Owner
Quantity
Cost
@foreach ($shopItems as $itemStock)
@php
$shop = $itemStock->shop;
@endphp
{!! $itemStock->item->displayName !!}
{!! $shop->displayName !!}
{!! $shop->user->displayName !!}
{!! $itemStock->quantity !!}
{!! $itemStock->cost !!} {!! $itemStock->currency->name !!}
@endforeach
@else
No shops are currently stocking the selected items.
@endif
@endif
@endsection