Skip to content

feat(auth): implement Laravel Breeze authentication with role-based Student/Admin dashboards and authorization#2

Draft
cto-new[bot] wants to merge 1 commit into
mainfrom
feat/auth-role-student-admin-laravel-breeze-fortify-session-login-redirect-seed
Draft

feat(auth): implement Laravel Breeze authentication with role-based Student/Admin dashboards and authorization#2
cto-new[bot] wants to merge 1 commit into
mainfrom
feat/auth-role-student-admin-laravel-breeze-fortify-session-login-redirect-seed

Conversation

@cto-new

@cto-new cto-new Bot commented Oct 22, 2025

Copy link
Copy Markdown

Summary

This PR implements authentication using Laravel Breeze and provides role-based (student/admin) dashboard access and redirects. The update enforces authorization via a custom middleware, separates user interfaces per role, and seeds both admin and student test accounts.

Details

  • Integrates Laravel Breeze Blade auth scaffolding for session-based authentication.
  • Adds role column to users table, updates User model fillable/casts, and introduces custom role middleware.
  • Implements dashboard route redirection based on user role.
  • Provides separate dashboards for students and admins with protected routes (role:student and role:admin).
  • Updates registration to force role=student for self-registration.
  • Seeds database with both admin and student user, including clear README setup/testing instructions.
  • Updates and adds feature tests for login, registration, role-based access, and authorization scenarios.
  • Migration required for new role column on users; breaking change for legacy data.

Warning: Task VM test is not passing, cto.new will perform much better if you fix the setup

…paration

Implements session-based authentication using Laravel Breeze, with custom role management and middleware to restrict access to admin and student dashboards. Adds database migration and seeding for user roles, distinct dashboard routes, and login handling to redirect based on user role. Updates feature tests for authentication, registration, and authorization. Improves the login UI with guidance and documents setup and usage in README.

This enables clean separation of permissions for students and admins and provides a scalable template for advanced RBAC or future role additions. Existing users will default to the student role unless otherwise modified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants