예제 #1
0
파일: Topic.php 프로젝트: JesadaMTK/issara
 protected static function boot()
 {
     parent::boot();
     static::addGlobalScope('content', function (Builder $builder) {
         $builder->where('types', 'topic');
     });
     Topic::creating(function ($topic) {
         $topic->user_id = Auth::user()->id;
         $topic->types = 'topic';
     });
 }