/** * Run the database seeds. * * @return void */ public function run() { $item = new MenuItem(); $item->item = "Spaghetti"; $item->price = 12.34; $item->save(); $item = new MenuItem(); $item->item = "Meat Lovers Pizza"; $item->price = 8.9; $item->save(); $item = new MenuItem(); $item->item = "Steak"; $item->price = 18.0; $item->save(); $item = new MenuItem(); $item->item = "Butter Chicken"; $item->price = 12.7; $item->save(); }
/** * Search for customers from phone Number * @return Customer */ public function search() { $query = Input::get('phone'); $cust = Customer::whereRaw('phoneMob = ?', array($query))->get(); $items = MenuItem::all(); if (!$cust->isEmpty()) { return view('order', compact('cust'))->withItems($items); } else { Session::flash('message', 'Customer not Found'); return Redirect::to('customers/create'); } }
/** * Display a listing of the resource. * * @return Response */ public function index() { return view('admin', ['customers' => Customer::select('id', 'name', 'phoneMob', 'address')->orderBy('name')->get(), 'items' => MenuItem::all(), 'stats' => Order::adminStats(), 'customerCount' => Customer::all()->count()]); }
/** * Display a listing of the resource. * * @return Response */ public function index() { return view('order', ['items' => MenuItem::all()]); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { //Remove a menu item $item = MenuItem::find($id); $item->delete(); //Redirect or somethign similar return Redirect::to('/menu'); }