function checkSlugInCategories($slug){
        $repet=true;
        $counter=1;
        $newSlug=$slug;

        while ($repet)
        {
            if(Categories::where('slug',$newSlug)->where('model_type',$this->type)->first())
            {
                $newSlug=$slug.'-'.$counter;
                $counter++;
            }
            else
                $repet=false;
        }

        return $newSlug;
    }