Example #1
0
 public static function getRecords($parameters)
 {
     $query = Winery::builder();
     if (isset($parameters['slug_190'])) {
         $query->where('slug_190', $parameters['slug_190']);
     }
     if (isset($parameters['lang_id_191'])) {
         $query->where('lang_id_191', $parameters['lang_id_191']);
     }
     if (isset($parameters['territorial_area_1_id_190'])) {
         $query->where('territorial_area_1_id_190', $parameters['territorial_area_1_id_190']);
     }
     if (isset($parameters['active_190'])) {
         $query->where('active_190', true);
     }
     return $query->get();
 }
Example #2
0
 public function apiCheckSlug()
 {
     return response()->json(['status' => 'success', 'slug' => Winery::checkSlug('slug_190', $this->request->input('slug'), $this->request->input('id'))]);
 }