39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
||
|
||
namespace App\Http\Controllers;
|
||
|
||
use Illuminate\Http\Request;
|
||
use App\Models\City;
|
||
use App\Services\MenuAccessService;
|
||
|
||
class HomeController extends Controller
|
||
{
|
||
/**
|
||
* コントローラーのインスタンス作成
|
||
* Laravel 12変更点:ミドルウェアは routes/web.php で処理するように変更
|
||
*
|
||
* @return void
|
||
*/
|
||
public function __construct()
|
||
{
|
||
// Laravel 12: ミドルウェアは routes/web.php で処理
|
||
// Laravel 5.7: $this->middleware('auth'); を使用していた
|
||
}
|
||
|
||
/**
|
||
* アプリケーションのダッシュボードを表示
|
||
* 認証後のホーム画面
|
||
*
|
||
* @param MenuAccessService $menuAccessService メニューアクセス制御サービス
|
||
* @return \Illuminate\Http\Response
|
||
*/
|
||
public function index(MenuAccessService $menuAccessService)
|
||
{
|
||
// ログイン中のオペレータが表示可能な自治体一覧を取得
|
||
$visibleCities = $menuAccessService->visibleCities();
|
||
$isSorin = $menuAccessService->isSorin();
|
||
|
||
return view('home', compact('visibleCities', 'isSorin'));
|
||
}
|
||
}
|