mindtwo/px-user-laravel
Laravel package that extends user management with a ready-to-use user model, authentication scaffolding, profile handling, and role/permission integration. Drop it into your app to centralize user logic and speed up building account features.
composer require mindtwo/px-user-laravel and run php artisan vendor:publish --tag=px-user-config (tag name may vary — check src/PxUserServiceProvider.php for the actual publish groups).config/px-user.php (endpoints, credentials, driver/guard wiring) and src/ for the guard, user provider, and any client/resource classes. That is the whole surface area of this package — there is no UI.config/auth.php (guards.web.provider → the package's provider, plus providers.px with the package's provider class) and set the related env vars (PX_USER_*, base URL, credentials).Auth::attempt($credentials) should hit the package provider transparently, then your app reads/writes the local users record as usual.4.1.9 and 4.1.10 and set it explicitly so behaviour is deterministic across environments.Illuminate\Contracts\Auth\UserProvider implementation. Everything your app does should go through Auth:: — do not call the package's client classes directly from controllers, or you lose the retry/token handling the provider gives you for free.App\Models\User) keyed by an external ID column. Keep that column indexed and unique; use firstOrCreate-style upserts on every login rather than assuming the remote IDs are stable.Auth::login($user, $remember). Do the sync inside a DB::transaction() if you also write profile fields, so a partially-synced user is never persisted.px_access_token / px_token_expires_at column or a cached entry) and refresh lazily on 401 rather than on a schedule. Wrap any outbound call in a small try/catch that maps remote 401s to a refresh and remote 5xx to a retryable exception.Http::fake() with fixtures captured from the real API and assert on the guard, not on the HTTP layer. Write one test per flow: successful login, invalid credentials (assert no local user created), remote outage (assert the login fails gracefully and does not half-create a user), and — new here — login with extended products enabled/disabled.config() mutation breaks under Octane and queued workers.php artisan config:clear (and config:cache in deploy). This is the single most common "the new option does nothing" report.Login event → queued job) and keep the login path to a single call.true or false in config/px-user.php — a release that changes login behaviour silently is worse than an opt-in. Pin it explicitly in your published config and in .env..env only; never log the raw remote response, since user payloads typically include the access token. Add a redaction list to your logging config (config/logging.php tap or a Monolog processor) around the package's channels.ValidationException. Temporarily add Http::globalRequestMiddleware/Http::fake logging or tail the package's log channel to see the actual remote status; do not enable verbose logging in production because of the token leak above.How can I help you explore Laravel packages today?