/** * * Index - if the user is logged in, allow them to proceed. * Otherwise, redirect to the log in page. */ public function index() { if (Auth::check()) { $items = Item::latest()->get(); return view('items.index', compact('items')); } else { return Redirect::to('auth/login'); } }
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('items.index', compact('items')); }
public function listByItems() { $items = Item::latest('created_at')->paginate(10); return view('inventory.inventoryavailability.index_byitems', compact('items')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { // $items = Item::latest('created_at')->with('itemclass')->paginate(10); return view('boms.index', compact('items')); }