'array', 'active' => 'boolean', ]; public function scopeActive(Builder $query): Builder { return $query->where('active', true); } public function users(): BelongsToMany { return $this->belongsToMany(User::class, 'academy_user_badges', 'badge_id', 'user_id') ->withPivot('awarded_at') ->withTimestamps(); } }