AuthLaravel: Sessions, roles and Inertia pages
AuthLaravel is an access-control learning project with a Laravel backend and Vue pages delivered through Inertia. The route definitions show how authenticated users reach their dashboard and how administrators receive a different view.
Repository languagesPHP 53.63%5
Shares calculated from GitHub Linguist bytes.
| Language | % | Bytes |
|---|---|---|
| PHP | 143,951 | |
| TypeScript | 94,085 | |
| Blade | 29,335 | |
| JavaScript | 999 | |
| CSS | 59 |
Overview
Why it exists
Clean Laravel authentication template implementing JWT, session management, and role-based policies.
Best fit
Secure boilerplate foundation for Laravel API and web applications.
Getting started
These commands come from the repository documentation. They were not run during this review.
./vendor/bin/sail up -d
npm build
./vendor/bin/sail artisan migrate
./vendor/bin/sail artisan db:seed
http://localhost/login
email: http://localhost:8025./vendor/bin/sail up -d
npm build
./vendor/bin/sail artisan migrate
./vendor/bin/sail artisan db:seed
http://localhost/login
email: http://localhost:8025Tasks declared in manifests
AuthLaravel/package.json
devvitebuildtsc && vite build && vite build --ssr
Repository references
Excerpts from the repository’s guides, in their original language. Links open the inspected source revision.
Prerequisites and first run
Requirements
README.md
- Docker
- Docker Compose
- Node.js
- NPM
- PHP 8.1.2
- Composer
Requirements
AuthLaravel/README.md
- Docker
- Docker Compose
- Node.js
- NPM
- PHP 8.1.2
- Composer
Features and components 2
- Routes and middleware
- The dashboard route uses auth and verified middleware, then tests the user’s admin role. The admin branch loads users and renders AdminDashboard; other users receive Dashboard. The /admin route has its own middleware declaration.
- Pages and account actions
- Inertia connects server-side route decisions to frontend pages. Profile editing delegates to ProfileController, while password-reset routes use Laravel’s password broker. Authentication and page selection are related but separate operations.
Architecture
The components and their connections remain available as text. The diagram adds an interactive view.
- Browser request
- Laravel middleware
- Role and route logic
- Inertia response
- Vue page
Links verified in the repository.
Mermaid Interactive diagram (loads on open)
System overview of the components and connections verified in the repository.

flowchart LR
subgraph group_routing["Request routing"]
node_web_routes["Web routes<br/>[web.php]"]
node_auth_routes["Auth routes<br/>[auth.php]"]
node_http_kernel["HTTP middleware<br/>[Kernel.php]"]
end
subgraph group_identity["Identity and access"]
node_login["Login handler"]
node_login_request["Login validation<br/>[LoginRequest.php]"]
node_registration["Registration handler"]
node_role_guard["Admin role guard"]
node_user["User identity model<br/>[User.php]"]
node_user_store[("User persistence<br/>[User.php]")]
end
subgraph group_account["Account services"]
node_profile["Profile management"]
node_email_verification["Email verification"]
node_verification_notice["Verification prompts"]
node_verification_email["Verification email"]
node_provider_login["Provider sign-in"]
end
subgraph group_client["Inertia client"]
node_inertia_middleware["Inertia request props"]
node_client_app["Inertia application<br/>[app.tsx]"]
node_auth_pages["Authentication pages<br/>[Login.tsx]"]
node_profile_page["Profile screen<br/>[Edit.tsx]"]
node_role_pages["Role dashboards and customer lists"]
end
node_visitor(("Browser user"))
node_visitor -.->|"requests pages"| node_web_routes
node_web_routes -->|"loads routes"| node_auth_routes
node_auth_routes -->|"routes login"| node_login
node_auth_routes -->|"routes registration"| node_registration
node_login -->|"authenticates with"| node_login_request
node_login_request -->|"uses identity"| node_user
node_registration -->|"creates account"| node_user
node_web_routes -->|"routes profile"| node_profile
node_profile -->|"updates account"| node_user
node_auth_routes -->|"routes verification"| node_email_verification
node_auth_routes -->|"routes prompt"| node_verification_notice
node_auth_routes -->|"routes notification"| node_verification_email
node_client_app -->|"resolves pages"| node_auth_pages
node_client_app -->|"resolves pages"| node_profile_page
node_client_app -->|"resolves pages"| node_role_pages
node_user -.->|"persists records"| node_user_store
node_auth_routes -.->|"optional sign-in"| node_provider_login
node_http_kernel -->|"registers middleware"| node_role_guard
node_visitor -.->|"uses role pages"| node_role_pages
class node_web_routes,node_auth_routes,node_http_kernel,node_visitor toneBlue
class node_login,node_login_request,node_registration,node_role_guard,node_user,node_user_store toneAmber
class node_profile,node_email_verification,node_verification_notice,node_verification_email,node_provider_login toneMint
class node_inertia_middleware,node_client_app,node_auth_pages,node_profile_page,node_role_pages toneRoseA Laravel and Inertia application for account access and role-based administration. Web routes connect login, registration, profiles, email verification, password recovery and optional provider sign-in to the shared user model and Inertia screens.
- Components
- 20
- Connections
- 19
- Links supported by code or README
- 16/19
Text version of the diagram
- Browser request → Laravel middleware
- Laravel middleware → Role and route logic
- Role and route logic → Inertia response
- Inertia response → Vue page
Follow one path through the code
Compare /dashboard with /admin in routes/web.php. Both select an administrative page, but their middleware differs. Authorization should be checked on the underlying data operations as well as on page navigation.
Types and file structure
43 declared types, with 12 in the base-relationship overview.
Type diagram
classDiagram
direction TB
class t1fe773fc7ae3["Kernel"] {
schedule()
commands()
}
class tfe51bb4928b0["Handler"] {
register()
}
class tf7ff8a2cab05["AuthenticatedSessionController"] {
create()
store()
destroy()
getBrowser()
}
class tbe9d5f7c0639["ConfirmablePasswordController"] {
show()
store()
}
class t50bb69bc248b["EmailVerificationNotificationController"] {
store()
}
class t16728102d86c["EmailVerificationPromptController"] {
__invoke()
}
class t927bbb823adb["NewPasswordController"] {
create()
store()
}
class ta16a6063a87f["PasswordController"] {
update()
}
class t0154a8c3ca84["PasswordResetLinkController"] {
create()
store()
}
class t50ceb4a72206["ProviderController"] {
redirect()
callback()
}
class t2737b9fd1b1c["RegisteredUserController"] {
create()
store()
getBrowser()
getOS()
}
class t23933425e397["VerifyEmailController"] {
__invoke()
}
class bce885b56bfe5["ConsoleKernel"] {
<<unresolved_base>>
}
t1fe773fc7ae3 ..> bce885b56bfe5 : declared base
class b0f719e4b7646["ExceptionHandler"] {
<<unresolved_base>>
}
tfe51bb4928b0 ..> b0f719e4b7646 : declared base
class b72f3a4384884["Controller"] {
<<unresolved_base>>
}
tf7ff8a2cab05 ..> b72f3a4384884 : declared base
class bac0ac8cfc274["Controller"] {
<<unresolved_base>>
}
tbe9d5f7c0639 ..> bac0ac8cfc274 : declared base
class b6a845f286ec8["Controller"] {
<<unresolved_base>>
}
t50bb69bc248b ..> b6a845f286ec8 : declared base
class b066194bb3cef["Controller"] {
<<unresolved_base>>
}
t16728102d86c ..> b066194bb3cef : declared base
class bdaab95927f7e["Controller"] {
<<unresolved_base>>
}
t927bbb823adb ..> bdaab95927f7e : declared base
class b74cef29cd3a3["Controller"] {
<<unresolved_base>>
}
ta16a6063a87f ..> b74cef29cd3a3 : declared base
class bbf0594294b45["Controller"] {
<<unresolved_base>>
}
t0154a8c3ca84 ..> bbf0594294b45 : declared base
class bf47dba55be58["Controller"] {
<<unresolved_base>>
}
t50ceb4a72206 ..> bf47dba55be58 : declared base
class b134294c7cccc["Controller"] {
<<unresolved_base>>
}
t2737b9fd1b1c ..> b134294c7cccc : declared base
class b8b1b484f3c15["Controller"] {
<<unresolved_base>>
}
t23933425e397 ..> b8b1b484f3c15 : declared base
Unresolved bases remain labelled; full signatures are not reconstructed.
Type index
Kernel(class) ·AuthLaravel/app/Console/Kernel.php:8Methods in the overview:
schedule, commands.Declared bases:
ConsoleKernel.Handler(class) ·AuthLaravel/app/Exceptions/Handler.php:8Methods in the overview:
register.Declared bases:
ExceptionHandler.AuthenticatedSessionController(class) ·AuthLaravel/app/Http/Controllers/Auth/AuthenticatedSessionController.php:15Methods in the overview:
create, store, destroy, getBrowser.Declared bases:
Controller.ConfirmablePasswordController(class) ·AuthLaravel/app/Http/Controllers/Auth/ConfirmablePasswordController.php:14Methods in the overview:
show, store.Declared bases:
Controller.EmailVerificationNotificationController(class) ·AuthLaravel/app/Http/Controllers/Auth/EmailVerificationNotificationController.php:10Methods in the overview:
store.Declared bases:
Controller.EmailVerificationPromptController(class) ·AuthLaravel/app/Http/Controllers/Auth/EmailVerificationPromptController.php:12Methods in the overview:
__invoke.Declared bases:
Controller.NewPasswordController(class) ·AuthLaravel/app/Http/Controllers/Auth/NewPasswordController.php:17Methods in the overview:
create, store.Declared bases:
Controller.PasswordController(class) ·AuthLaravel/app/Http/Controllers/Auth/PasswordController.php:11Methods in the overview:
update.Declared bases:
Controller.PasswordResetLinkController(class) ·AuthLaravel/app/Http/Controllers/Auth/PasswordResetLinkController.php:13Methods in the overview:
create, store.Declared bases:
Controller.ProviderController(class) ·AuthLaravel/app/Http/Controllers/Auth/ProviderController.php:12Methods in the overview:
redirect, callback.Declared bases:
Controller.RegisteredUserController(class) ·AuthLaravel/app/Http/Controllers/Auth/RegisteredUserController.php:17Methods in the overview:
create, store, getBrowser, getOS.Declared bases:
Controller.VerifyEmailController(class) ·AuthLaravel/app/Http/Controllers/Auth/VerifyEmailController.php:11Methods in the overview:
__invoke.Declared bases:
Controller.
Reference
120 / 120 eligible files read (148 in the tree); 0 oversized, 0 failed reads and 0 syntax diagnostics.
What the scan covers
Known dependency/build folders, credential files and binaries are excluded. The scan covers READMEs, recognized manifests and parser-supported source files.
Linguist statistics cover the whole repository and may include other languages.
File map
flowchart TD
root["AuthLaravel"]
f0["AuthLaravel/composer.json"]
root --> f0
f1["AuthLaravel/package.json"]
root --> f1
f2["AuthLaravel/routes/web.php"]
root --> f2
f3["README.md"]
root --> f3
f4["AuthLaravel/README.md"]
root --> f4
f5["AuthLaravel/docker-compose.yml"]
root --> f5
f6["AuthLaravel/postcss.config.js"]
root --> f6
f7["AuthLaravel/tailwind.config.js"]
root --> f7
f8["AuthLaravel/vite.config.js"]
root --> f8
f9["AuthLaravel/bootstrap/app.php"]
root --> f9
f10["AuthLaravel/config/app.php"]
root --> f10
f11["AuthLaravel/config/auth.php"]
root --> f11
f12["AuthLaravel/config/broadcasting.php"]
root --> f12
f13["AuthLaravel/config/cache.php"]
root --> f13
f14["AuthLaravel/config/cors.php"]
root --> f14
f15["AuthLaravel/config/database.php"]
root --> f15