*/ use HasFactory; protected function casts(): array { return [ 'capabilities' => 'array', 'tags' => 'array', 'featured' => 'boolean', 'approved' => 'boolean', ]; } protected static function booted(): void { static::creating(function (McpServer $server) { if (empty($server->slug)) { $server->slug = Str::slug($server->name); } }); } /** * @return BelongsTo */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * @param Builder $query */ #[Scope] protected function approved(Builder $query): void { $query->where('approved', true); } protected function categoryLabel(): Attribute { return Attribute::get(fn () => config("mcp_servers.categories.{$this->category}", $this->category)); } protected function transportLabel(): Attribute { return Attribute::get(fn () => $this->transport ? config("mcp_servers.transports.{$this->transport}", $this->transport) : null); } }