Closed ju-ki closed 2 months ago
新しい AdminController
クラスが追加され、管理者ダッシュボード用の API エンドポイントが提供されました。また、Laravel パッケージの spatie/laravel-permission
を導入し、ユーザーの役割と権限の管理が強化されました。これにより、管理エリアへのアクセス制御が改善され、認証されたユーザーのみが /admin
エンドポイントにアクセスできるようになりました。
ファイル | 変更概要 |
---|---|
backend/app/Http/Controllers/API/AdminController.php |
AdminController を追加し、管理者ダッシュボードへのアクセスを提供する index() メソッドを実装。 |
backend/bootstrap/app.php |
新しいミドルウェア EnsureFrontendRequestsAreStateful を追加し、状態管理を強化。 |
backend/composer.json |
spatie/laravel-permission パッケージを依存関係として追加。 |
backend/config/app.php |
Spatie\Permission\PermissionServiceProvider をサービスプロバイダーとして追加。 |
backend/config/fortify.php |
'home' の値を '/home' から '/admin' に変更。 |
backend/routes/api.php |
/admin ルートを追加し、AdminController@index メソッドにマッピング。 |
backend/tests/Feature/AdminAccessTest.php |
管理者アクセスのテストを実装し、認証の確認を追加。 |
backend/tests/Feature/AuthTest.php |
ユーザー認証とログイン後のリダイレクトをテストするメソッドを追加。 |
sequenceDiagram
participant User
participant API
participant AdminController
User->>API: GET /admin
API->>AdminController: index()
AdminController-->>API: JSON response (admin dashboard accessible)
API-->>User: 200 OK
🐇 うさぎの詩 🐇
新しいルートにワクワク、
管理者の道、今は開く。
権限管理も、すっきりと、
認証された者、自由に行く。
うさぎも跳ねて、夢広げ、
ダッシュボードの扉、今ここに! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@coderabbitai review
This PR is automatically created by GitHub Actions
Summary by CodeRabbit
新機能
バグ修正
テスト