/** * Whenever a user is created, create a new slug based on their username. */ public static function boot() { parent::boot(); static::creating(function ($discussion) { $discussion->updateSlug(); }); }
/** * Whenever a user is created, create a new slug based on their username. */ public static function boot() { parent::boot(); static::creating(function ($user) { $user->slug = Slug::fromTitle($user->username); }); }
/** * Whenever a user is created, create a new slug based on their username. */ public static function boot() { parent::boot(); static::creating(function ($category) { $category->updateSlug(); }); }
public static function boot() { parent::boot(); static::created(function ($comment) { $comment->slug = Slug::fromId($comment->id); }); }