public function search(Request $request) { $key = $request->input('key'); if ($key == '') { return redirect('items'); } $items = Item::latest('created_at')->where('item_number', 'like', '%' . $key . '%')->orWhere('item_name', 'like', '%' . $key . '%')->paginate(10); return view('product.items.index', compact('items')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { // $items = Item::latest('created_at')->with('itemclass')->paginate(10); return view('product.boms.index', compact('items')); }