/**
  * 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();
     });
 }
Exemplo n.º 2
0
 /**
  * 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);
     });
 }
Exemplo n.º 3
0
 /**
  * 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();
     });
 }
Exemplo n.º 4
0
 public static function boot()
 {
     parent::boot();
     static::created(function ($comment) {
         $comment->slug = Slug::fromId($comment->id);
     });
 }