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'; }); }