- What is kabiroman/octawire-auth-service-php-client used for?
- It is a lightweight PHP client for connecting an application to the Octawire authentication service. Instead of writing raw HTTP request logic yourself, you use a tidy API to authenticate users, validate sessions, and handle token-based auth responses. It is designed to fit cleanly into Laravel projects but also works in any Composer-based PHP app.
- How do I install the Octawire auth client in a Laravel project?
- Install it with Composer using composer require kabiroman/octawire-auth-service-php-client. The package includes Laravel service provider and facade support, so it is intended to be registered through Laravel's normal package discovery or provider configuration. Check the package README for the exact provider and alias entries if your Laravel version does not auto-discover them.
- How do I configure the Octawire base URL and credentials?
- The client is designed to read its base URL and credentials from environment variables, which keeps secrets out of your source code. Add the required values to your .env file and, if the package ships a config file, publish it so you can reference those environment variables. The overview does not list the exact variable names, so confirm them in the README or package config.
- Does this package support Laravel facades and service providers?
- Yes. The package is explicitly described as including a Laravel service provider and facade support. That means you can resolve the client through Laravel's container or call it through the facade in your controllers and services. If auto-discovery is not available, register the provider and alias manually in your Laravel configuration.
- Which Laravel and PHP versions are supported?
- The package overview does not specify a Laravel or PHP version range, so you should verify compatibility in the package's composer.json before adopting it. It is described as framework-friendly for Laravel and usable in any Composer-based PHP application. Checking the require constraints is the safest way to confirm it matches your project's runtime.
- How do I authenticate a user and validate a session with this client?
- The client wraps the Octawire HTTP API in a simple, expressive API for token-based authentication. You use it to send authentication requests and to validate sessions instead of hand-rolling request logic. The exact method names and request payloads are defined in the package README, so follow those examples for login and session checks.
- What happens when authentication fails or a token is expired?
- The package provides clear exceptions for failed or expired authentication requests. That lets you catch auth-specific failures and return appropriate responses, such as redirecting to login or refreshing credentials. You should handle these exceptions in your application rather than assuming every auth-service call succeeds.
- Can I use this client outside Laravel in a plain PHP app?
- Yes. Although it is designed to drop cleanly into Laravel, it remains usable in any Composer-based PHP application. The client uses a PSR-compatible HTTP transport and returns typed responses, so it can be integrated without Laravel's container or facade. You will need to configure the base URL and credentials yourself in that setup.
- How should I test code that uses the Octawire auth client?
- The overview does not document a dedicated testing helper or fake, so check the package source and README for transport injection options. Because the client relies on a PSR-compatible HTTP transport, you can typically test your integration by substituting a test HTTP client or mocking the auth-service responses. Keep tests focused on how your app handles successful auth, expired tokens, and thrown exceptions.
- Is this package actively maintained and where do I report issues?
- The provided package metadata does not include a repository URL or maintenance status, so verify the latest release date and issue tracker on Packagist before relying on it in production. Check that the published versions match your Laravel and PHP constraints. If you find a bug, use the repository's issue tracker once you locate it from the Packagist listing.