orderBy('orderby', 'asc')->findWhere([ 'is_active' => true ]); } /** * Return active plans except $planId * @param $planId * @return mixed */ public function activePlansExcept($planId) { return $this->orderBy('orderby', 'asc')->findWhere([ ['is_free','=', false], ['is_active','=', true], ['id','<>', $planId] ]); } }