- Route Model Binding → 수동 조회로 변경 (board_code + tenant_id) - PostController: resolveBoard() 헬퍼 추가 - t 파라미터 → 시스템 게시판 → 로그인 회원 tenant 순서 - 사이드바 메뉴 리다이렉트: tenant_id ?? 1 fallback 추가 - SidebarMenuService와 동일한 로직으로 일관성 확보 - 게시판 목록 테이블에 게시글 수 컬럼 추가 - 모든 posts View에 tenant_id 파라미터 추가 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
46 lines
911 B
PHP
46 lines
911 B
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();
|
|
|
|
return view('boards.index', compact('boardTypes'));
|
|
}
|
|
|
|
/**
|
|
* 게시판 생성 화면
|
|
*/
|
|
public function create(): View
|
|
{
|
|
return view('boards.create');
|
|
}
|
|
|
|
/**
|
|
* 게시판 수정 화면
|
|
*/
|
|
public function edit(int $id): View
|
|
{
|
|
$board = $this->boardService->getBoardById($id, true);
|
|
|
|
if (! $board) {
|
|
abort(404, '게시판을 찾을 수 없습니다.');
|
|
}
|
|
|
|
return view('boards.edit', compact('board'));
|
|
}
|
|
}
|