/**
  * 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();
 }
Ejemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 function index()
 {
     return view('locations')->with(['locations' => Location::all()->sortBy('region'), 'regions' => Region::all()]);
 }
Ejemplo n.º 3
0
 function offer($id)
 {
     return view('offer')->with(['offer' => Offer::findOrFail($id), 'locations' => Location::all()]);
 }
Ejemplo n.º 4
0
 public function index()
 {
     // show all
     $records = Location::all();
     return $records;
 }