Example #1
0
 /**
  * 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();
 }
Example #2
0
 /**
  * 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');
     }
 }
Example #3
0
 /**
  * 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()]);
 }
Example #4
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return view('order', ['items' => MenuItem::all()]);
 }
Example #5
0
 /**
  * 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');
 }