Route::get('check', function()
{
$items = new App\Goods;
echo "Total of goods: " . $items->count() . "";
if ($size = \Input::get('size')) {
$items = $items->where('size', $size);
}
if ($color = \Input::get('color')) {
$items = $items->where('color', $color);
}
if ($price = \Input::get('price')) {
$items = $items->where('price', '<=', $price);
}
if ($amounts = \Input::get('amounts')) {
$items = $items->where('amounts', '<=', $amounts);
}
echo "Total of goods after the filtering: " . $items->count();
});
Route::get('check', function()
{
$items = App\Goods::all();
echo "Total of goods: " . $items->count() . "";
if ($size = \Input::get('size')) {
$items = $items->where('size', $size);
}
if ($color = \Input::get('color')) {
$items = $items->where('color', $color);
}
if ($price = \Input::get('price')) {
$items = $items->where('price', '<=', $price);
}
if ($amounts = \Input::get('amounts')) {
$items = $items->where('amounts', '<=', $amounts);
}
echo "Total of goods after the filtering: " . $items->count();
});