Ejemplo n.º 1
0
 /**
  * get list of stops based on location
  *
  * @param  int  $location_id
  * @return Response
  */
 public function getByLocation($location_id)
 {
     if ($location_id) {
         // get all stops based on the condition
         $stops = Stop::LocationId($location_id)->get();
     } else {
         // get all
         $stops = Stop::get();
     }
     if ($stops->count()) {
         echo json_encode($stops);
     } else {
         echo json_encode(array());
     }
 }