테넌트 게시판 수정 404 오류: - BoardService.getBoardById()에 $systemOnly 파라미터 추가 - BoardController.edit()에서 systemOnly=false로 테넌트 게시판 조회 가능 - Api/Admin/BoardController에서 show/update 메서드 테넌트 게시판 지원 - updateAnyBoard() 메서드 사용하여 시스템/테넌트 게시판 공통 수정 메뉴 페이지네이션 쿠키 값 미적용 오류: - HTMX 요청 시 htmx:configRequest 이벤트로 쿠키 값 적용 - pagination_per_page 쿠키에서 per_page 값 읽어서 요청 파라미터에 설정 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
48 lines
1.0 KiB
PHP
48 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
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();
|
|
$currentTenant = auth()->user()->currentTenant();
|
|
|
|
return view('boards.index', compact('boardTypes', 'currentTenant'));
|
|
}
|
|
|
|
/**
|
|
* 게시판 생성 화면
|
|
*/
|
|
public function create(): View
|
|
{
|
|
return view('boards.create');
|
|
}
|
|
|
|
/**
|
|
* 게시판 수정 화면
|
|
*/
|
|
public function edit(int $id): View
|
|
{
|
|
// systemOnly=false: 테넌트 게시판도 수정 가능
|
|
$board = $this->boardService->getBoardById($id, true, false);
|
|
|
|
if (! $board) {
|
|
abort(404, '게시판을 찾을 수 없습니다.');
|
|
}
|
|
|
|
return view('boards.edit', compact('board'));
|
|
}
|
|
}
|