public function setSlugAttribute($slug)
    {
        if ( ! $slug) {
            $title = is_null($this->name) ? $this->title : $this->name;
            $slug = str_slug($title, '-');
        }

        $this->attributes['slug'] =  $slug;
    }
public function setSlugAttribute($slug)
    {
        if ( ! $slug) {
            $title = is_null($this->name) ? $this->title : $this->name;
            $slug = str_slug($title, '-');
        }

        $this->attributes['slug'] =  $slug;
    }
public function setSlugAttribute ( $ slug ) { if ( ! $ slug ) { $ title = is_null ( $ this -> name ) ? $ this -> title : $ this -> name ; $ slug = str_slug ( $ title , '-' ) ; } $ this -> attributes [ 'slug' ] = $ slug ; }
Set slug encrypted

@param $slug
Set slug encrypted