type ?? null; if($type){ $tarifs = Tarif::where('type', $type)->orderBy('lft', 'asc')->get(); if(count($tarifs) < 1){ return $this->errorNotFound(); } }else{ $tarifs = Tarif::orderBy('lft', 'asc')->get(); } return $this->respondWithCollection($tarifs, new TarifTransformer($this->locale)); } }