- 라우트 파라미터 충돌 수정 (Layer 4 확장) - TenantScope 글로벌 스코프가 테넌트 콘솔에서 올바른 tenant_id 사용하도록 수정 - 감사로그 상세 테넌트 콘솔 레이아웃 적용 - 테넌트 전환: 모달 → 컨텍스트 메뉴로 이동, 스타일 변경 (녹색+전환아이콘) - 테넌트 전환 이벤트를 openTenantConsole 호출로 통일 - 사이드바 스타일 메인과 통일 + 리포트 주의사항 정리
56 lines
1.4 KiB
PHP
56 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Helpers\TenantHelper;
|
|
use App\Models\Tenants\Tenant;
|
|
use App\Services\BoardService;
|
|
use Illuminate\View\View;
|
|
|
|
class BoardController extends Controller
|
|
{
|
|
public function __construct(
|
|
private readonly BoardService $boardService
|
|
) {}
|
|
|
|
/**
|
|
* 게시판 목록 (Blade 화면)
|
|
*/
|
|
public function index(): View
|
|
{
|
|
$boardTypes = $this->boardService->getBoardTypes();
|
|
$consoleTenantId = TenantHelper::getEffectiveTenantId();
|
|
$currentTenant = TenantHelper::isTenantConsole()
|
|
? Tenant::find($consoleTenantId)
|
|
: auth()->user()->currentTenant();
|
|
|
|
return view('boards.index', compact('boardTypes', 'currentTenant'));
|
|
}
|
|
|
|
/**
|
|
* 게시판 생성 화면
|
|
*/
|
|
public function create(): View
|
|
{
|
|
return view('boards.create');
|
|
}
|
|
|
|
/**
|
|
* 게시판 수정 화면
|
|
* tenant-console/{tenantId}/boards/{id}/edit 에서
|
|
* $id에 tenantId가 들어오는 문제 방지 → route('id')로 명시적 추출
|
|
*/
|
|
public function edit(int $id): View
|
|
{
|
|
$id = (int) (request()->route('id') ?? $id);
|
|
// systemOnly=false: 테넌트 게시판도 수정 가능
|
|
$board = $this->boardService->getBoardById($id, true, false);
|
|
|
|
if (! $board) {
|
|
abort(404, '게시판을 찾을 수 없습니다.');
|
|
}
|
|
|
|
return view('boards.edit', compact('board'));
|
|
}
|
|
}
|