Exemplo n.º 1
0
 protected static function boot()
 {
     parent::boot();
     static::creating(function ($article) {
         if ($article['username'] == null) {
             $article['username'] = Auth::user()->username;
         }
     });
 }