public function index() { // $locations = Location::all(); // return view('locations',['locations'=>$locations]); $locations = Location::with('stories')->get(); return view('locations', ['locations' => $locations]); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $state = \Input::get('state'); $county = \Input::get('county'); $location = \App\Location::with('products')->where(['state' => $state, 'county' => $county])->firstOrFail(); $products = $location->products; return view('products.index', compact('location', 'products')); }
/** * Display a listing of the resource. * * @return Response */ public function search(Request $request) { if ($request->input('term')) { $locations = Location::with('latestPrice')->where('address', 'like', $request->input('term') . '%')->orderBy('address')->orderBy('number')->get(); $search = true; } else { $locations = Location::with('latestPrice')->orderBy('address')->orderBy('number')->get(); $search = false; } return response()->json(["status" => "OK", "search" => $search, "data" => $locations]); }
public function dashboard() { $today = Carbon::today('Europe/Brussels'); $now = Carbon::now('Europe/Brussels'); $clients = Client::where('leavetime', '=', null)->get(); $clientsWithTable = collect([]); foreach ($clients as $client) { if ($client->table != null) { $clientsWithTable->push($client); } } foreach ($clientsWithTable as $client) { if (count($client->orders) > 0) { $order = $client->orders()->where('endtime', '=', null)->first(); if ($order) { $client->wait_time = $now->diffInMinutes(Carbon::createFromFormat('Y-m-d H:i:s', $order->starttime)); } } } $areas = ['' => 'Gebieden'] + Area::orderby('name', 'ASC')->lists('name', 'id')->all(); $locations = Location::with('table')->with('decoration')->get(); return View::make('dashboard')->with('today', $today)->with('clientsWithTable', $clientsWithTable)->with('areas', $areas)->with('locations', $locations); }
public function index() { $location = Location::with('storys')->get(); //$location = Location::all(); return view('locations', ['locations' => $location]); }
public function index() { $locations = Location::with('Stories')->get(); return view('locations', ['locations' => $locations]); }
public function index() { $locations = Location::with(’stories’)->get(); return view(‘locations’, [‘locations’ => $locations]); }