'integer', ]; /** * 사용자 관계 */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * 기본 정렬 스코프 */ public function scopeOrdered($query) { return $query->orderBy('display_order')->orderBy('created_at'); } /** * HTTP 메서드 배지 색상 */ public function getMethodColorAttribute(): string { return match (strtoupper($this->method)) { 'GET' => 'green', 'POST' => 'blue', 'PUT' => 'yellow', 'PATCH' => 'orange', 'DELETE' => 'red', default => 'gray', }; } }