public static function fromId($id)
    {
        $salt = md5(uniqid().$id);
        $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $slug = with(new Hashids($salt, $length = 8, $alphabet))->encode($id);

        return new Slug($slug);
    }
public static function fromId($id)
    {
        $salt = md5(uniqid().$id);
        $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $slug = with(new Hashids($salt, $length = 8, $alphabet))->encode($id);

        return new Slug($slug);
    }
public static function fromId ( $ id ) { $ salt = md5 ( uniqid ( ) . $ id ) ; $ alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ; $ slug = with ( new Hashids ( $ salt , $ length = 8 , $ alphabet ) ) -> encode ( $ id ) ; return new Slug ( $ slug ) ; }
Generate a new 8-character slug.

@param integer $id
@return Slug
Generate a new 8 - character slug .