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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package auth

Auth

codecov

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

PHP Build Version
Package Version
Requires php Version ^8.4
patrikjak/utils Version ^2.10.0
laravel/framework Version ^12.1.1
laravel/socialite Version ^5.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package patrikjak/auth contains the following files

Loading the files please wait ...