public static function getRecords($parameters) { $query = Spa::builder(); if (isset($parameters['slug_180'])) { $query->where('slug_180', $parameters['slug_180']); } if (isset($parameters['lang_id_181'])) { $query->where('lang_id_181', $parameters['lang_id_181']); } if (isset($parameters['territorial_area_1_id_180'])) { $query->where('territorial_area_1_id_180', $parameters['territorial_area_1_id_180']); } if (isset($parameters['active_180'])) { $query->where('active_180', true); } return $query->get(); }
public function apiCheckSlug() { return response()->json(['status' => 'success', 'slug' => Spa::checkSlug('slug_180', $this->request->input('slug'), $this->request->input('id'))]); }