feat: menus 테이블 options JSON 컬럼 추가

- menus 테이블에 options JSON 컬럼 추가 (확장 데이터 저장용)
- Menu 모델에 options 헬퍼 메서드 추가
  - getOption(), setOption()
  - getRouteName(), getSection(), getMenuType()
  - requiresRole(), getBladeComponent(), getCssClass()
  - getMeta(), setMeta()
- JSON 컬럼 기반 스코프 메서드 추가
  - scopeSection(), scopeMenuType(), scopeRequiringRole()
This commit is contained in:
2025-12-16 14:47:47 +09:00
parent ad56e94988
commit 52ba867a3c
2 changed files with 166 additions and 2 deletions

View File

@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* menus 테이블에 options JSON 컬럼 추가
* - 범용 확장 데이터 저장용 (mng, api, react 등에서 활용 가능)
* - nullable이므로 기존 데이터에 영향 없음
*/
public function up(): void
{
Schema::table('menus', function (Blueprint $table) {
$table->json('options')->nullable()
->after('external_url')
->comment('확장 옵션 JSON: route_name, section, menu_type, requires_role, meta 등');
});
}
public function down(): void
{
Schema::table('menus', function (Blueprint $table) {
$table->dropColumn('options');
});
}
};