- What is escolalms/auth and what does it do?
- escolalms/auth is a Laravel authentication package built for the Escola LMS ecosystem. It ships a ready-to-use auth layer for API-driven applications, including token-based authentication, registration and login endpoints, password reset, and configurable guards. It is designed to plug into Escola's user model so login flows stay consistent across the other Escola packages you install.
- How do I install escolalms/auth in a Laravel application?
- Install it with Composer using composer require escolalms/auth. Because it targets the Escola LMS ecosystem, you will typically also need the related Escola user and role packages for the user model and permissions to resolve correctly. After installing, publish any provided configuration and run your migrations before calling the auth endpoints.
- Which Laravel versions does escolalms/auth support?
- The package's supported Laravel and PHP versions are declared in its composer.json requirements rather than in the overview text. Check that file, or run composer require escolalms/auth and review the dependency constraints Composer resolves, before committing to an upgrade path. If you are on an older or very new Laravel release, verify compatibility with a quick test install first.
- How does token-based API authentication work in escolalms/auth?
- The package issues tokens so stateless API clients and SPAs can authenticate without session cookies. Requests then send the token in the standard Authorization header, and the configured guard resolves the token to an Escola user. The underlying token implementation and its exact configuration keys are defined in the package source, so confirm the details there before wiring up your frontend.
- Can I configure authentication guards in escolalms/auth?
- Yes. Guards and authentication settings are configurable, which lets you keep separate guard definitions for API tokens and other flows. In practice you adjust the package config plus your application's auth.php so the guard names, providers, and user model line up. Review the published config file after installation to see the available options.
- Does escolalms/auth provide registration and password reset endpoints out of the box?
- Yes. The package includes registration and login endpoints plus password reset and account recovery support, so you do not have to hand-build those controllers. Routes are defined by the package, so check the route list with php artisan route:list after installing to see the exact URIs and middleware applied. You can then override or extend the behaviour where your application needs custom rules.
- Does escolalms/auth work with the Escola LMS user and role packages?
- It is designed for exactly that. The auth layer integrates with Escola's user model and is meant to standardize login flows across Escola packages, including the role and permission packages. Install the matching Escola dependencies so the user provider and token issuance resolve against the expected models.
- Can I use escolalms/auth in a Laravel app that is not part of Escola LMS?
- It is technically installable anywhere Composer allows, but the package assumes Escola's user model and ecosystem conventions. Using it outside Escola usually means adapting or replacing the user provider and potentially pulling in extra Escola dependencies. If you only need generic Laravel auth, a framework-native option such as Laravel Sanctum, Fortify, Breeze, or Passport is likely a lighter fit.
- How do I test authentication endpoints built with escolalms/auth?
- Write Laravel feature tests that hit the login, registration, and password reset routes and assert the JSON responses and issued tokens. Use RefreshDatabase or DatabaseTransactions so test users are cleaned up, and seed the Escola user and role records your guards expect. For token-protected routes, assert both the unauthenticated 401 and the authenticated success case.
- Is escolalms/auth actively maintained and safe for production use?
- Before relying on it in production, check the repository's recent commit activity, tagged releases, and open issues, since the package is tied to the Escola LMS release cycle. Also confirm token lifetimes, HTTPS enforcement, and rate limiting on the login and password reset routes in your own application. Running the full test suite against your Laravel version is the quickest way to validate it before deployment.