- What is linkorb/flex-auth used for?
- linkorb/flex-auth is a flexible authentication layer for Laravel and PHP applications. It lets you configure login flows, guards and user providers through configuration instead of hard-coding a single guard or provider. It suits projects that need adaptable credential handling while keeping their existing user models.
- How do I install linkorb/flex-auth?
- Install it with Composer using composer require linkorb/flex-auth. After that, follow the configuration steps in the repository README to register the service provider and publish any config files your application needs. Commit the updated composer.json and composer.lock so other environments install the same version.
- Which Laravel and PHP versions does linkorb/flex-auth support?
- The package is aimed at Laravel and Laravel-style PHP applications, but the exact framework and PHP version constraints live in its composer.json. Check that file and the README before installing, especially if you are on the newest Laravel major release. If your constraints do not match, Composer will refuse the install and tell you which versions conflict.
- Can I configure multiple guards and user providers with flex-auth?
- Yes. The package is built around configurable guards and supports multiple user providers and credential sources, so different parts of an application can authenticate against different models or data sources. You define the guards and providers in configuration rather than duplicating login logic. This is useful for apps with separate admin, customer or API identities.
- How do I add custom login or authorization logic?
- flex-auth exposes extensible hooks for custom login and authorization logic, so you can adapt the flow without forking the package. Register your custom behavior in your application's service provider or config and keep the logic in your own classes. Because drivers are pluggable, you can also swap in your own authentication driver when the built-in ones do not fit.
- How do I configure authentication differently per environment?
- Setup is configuration-driven, which means you can vary guards, providers and credential sources per environment. Keep secrets and environment-specific values in environment variables and reference them from your config files, rather than committing them. Running the config cache command in production keeps resolution fast and consistent.
- Can I use linkorb/flex-auth outside a full Laravel application?
- The package is described as a lightweight integration for Laravel and PHP applications, so plain PHP projects may be able to use parts of it. How much of the framework it expects depends on the implementation details in the repository and its Composer requirements. Check composer.json and the README for dependency expectations before choosing it for a non-Laravel codebase.
- How do I test authentication flows built with flex-auth?
- Because authentication drivers are pluggable, you can substitute a fake or in-memory driver in your test suite and assert which guard and provider were selected. Test the configuration resolution separately from the credential check so failures are easy to diagnose. If you use Laravel's testing helpers, the usual assertion and acting-as utilities should still apply to your user models.
- How does flex-auth compare to Laravel's built-in authentication?
- Laravel's built-in authentication already covers guards, providers and common login flows, so start there unless you need more configurability. flex-auth positions itself as a lightweight, configuration-driven layer for projects that need adaptable credential handling and custom login hooks with less boilerplate. Compare the repository's feature set and activity against your requirements before switching.
- Is linkorb/flex-auth actively maintained and safe for production?
- Before using it in production, check the repository's recent commits, releases and open issues to judge maintenance activity. Pin a specific version in composer.json and review the source for the authentication paths you rely on, since authentication is security-sensitive. Also confirm the version you choose is compatible with your Laravel and PHP constraints.