/** * Display the specified resource. * * @param int $id * @return Response */ public function typeahead() { $locations = Location::all(); $all = []; foreach ($locations as $location) { $row = new \stdClass(); $row->id = $location->id; $row->name = $location->name; $all[] = $row; } $this->data->data = $all; return $this->json(); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ function index() { return view('locations')->with(['locations' => Location::all()->sortBy('region'), 'regions' => Region::all()]); }
function offer($id) { return view('offer')->with(['offer' => Offer::findOrFail($id), 'locations' => Location::all()]); }
public function index() { // show all $records = Location::all(); return $records; }