Download the PHP package patrikjak/auth without Composer
On this page you can find all versions of the php package patrikjak/auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package auth
Auth
Simple auth package for Laravel apps. Requires patrikjak/utils.
Installation
Setup
Register both service providers in bootstrap/providers.php:
Run the install command to publish all assets, config, migrations, and translations, remove default Laravel auth migrations, run fresh migrations, and seed default roles:
Or publish individually:
To keep config up to date on every composer update, add to your composer.json:
Laravel cannot merge multidimensional arrays in config files, so the config must be re-published after updates.
Configuration
All options live in config/pjauth.php.
Custom User model
Default is Patrikjak\Auth\Models\User.
Custom repository
The custom implementation must implement Patrikjak\Auth\Repositories\Interfaces\UserRepository.
Redirects
Feature flags
All features are enabled by default except register_via_invitation:
Routes are only registered when their respective feature is enabled.
Routes
Web routes use ['web', 'guest'] middleware. API routes use ['web', 'guest'] for unauthenticated endpoints and ['web', 'auth'] for authenticated ones.
Middleware
Use VerifyRole to protect routes by role:
Super admins pass all role checks.
Roles
Default roles are defined in config/pjauth.php under default_roles. Use pjauth:sync-roles to seed them — see Artisan Commands.
Artisan Commands
Sync roles
Seeds roles from pjauth.default_roles config into the database (uses firstOrCreate — safe to re-run).
Create users interactively
Prompts for name, email, password, and role. Loops until you decline to add another user.
Send register invite
If --role is not provided, available roles are listed and you are prompted to choose.
Socialite (Google)
Enable in config (enabled by default) and add credentials:
Add to config/services.php:
Register via Invitation
Enable the feature flag:
When enabled, the invitation routes are registered. Google social login on the login screen remains available so existing users can still sign in via Google — only the "sign up with Google" button on the register screen is hidden, and Google OAuth cannot be used to create a new account.
Send an invite from the command line — see Artisan Commands.
The invite email contains a tokenised link to GET /register/{token}?email=.... On submission it calls POST /api/invite/register.
Change Password
Enable the feature flag (enabled by default):
Call the authenticated endpoint:
Request body:
Old password validation is on by default. To skip it (e.g. admin resetting another user's password):
reCAPTCHA
Enabled by default on register, login, and password reset API endpoints. Disable globally:
Or provide the keys:
All versions of auth with dependencies
patrikjak/utils Version ^2.10.0
laravel/framework Version ^12.1.1
laravel/socialite Version ^5.16