Download the PHP package inlayphp/authorization-spatie without Composer

On this page you can find all versions of the php package inlayphp/authorization-spatie. 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 authorization-spatie

Inlay Authorization — Spatie Adapter

Packagist PHP

Spatie Laravel Permission synchronization and super-admin integration for Inlay

inlayphp/authorization-spatie is the official optional adapter between the Inlay ability registry and spatie/laravel-permission. It supplies permission synchronization, a configurable Gate-level super-admin role, and request-safe Spatie team selection.

Optional package boundary

The lean inlayphp/inlay installation uses native Laravel Gate and Policies and intentionally does not require a permission database. Install this adapter only when an application wants Spatie roles/permissions to persist and bundle registered Inlay abilities.

The adapter is standalone:

If Policies and application-owned Gates are sufficient, stay with the clean core authorization package and do not install this adapter.

Installation

Install and configure Spatie Laravel Permission first, including its migrations and HasRoles trait, then add the adapter:

Laravel package discovery registers the provider. The adapter supports Spatie Laravel Permission 6–8 and Laravel 12.

The published configuration contains:

Synchronize abilities

Register all Inlay abilities during application/package boot, then preview and apply changes:

The command creates missing permissions for the selected guard and clears Spatie's permission cache after a write. Existing matches are retained. Stored permissions not declared in the Inlay registry are reported as stale but are not removed by default.

Pruning is deliberately explicit:

--prune without --force fails. Review the dry-run output before deleting permissions, particularly when non-Inlay features share the same guard.

You can invoke the adapter without a command:

The configured Spatie permission model must be an Eloquent model implementing Spatie's Permission contract.

Super administrator

The service provider registers Gate::before(). A user with the configured role receives true before normal Gate/policy evaluation:

Set super_admin_role to an empty/non-string value to disable this shortcut. The user object must implement hasRole(), normally through Spatie's HasRoles trait. Because this bypass applies to all Laravel Gate checks, protect assignment of the role and test it carefully.

Team-aware authorization

Spatie teams remain opt-in. Enable teams in Spatie's permission.php, select a resolver, and add the middleware after authentication and session middleware:

SessionTeamResolver accepts an integer, string, or Eloquent model from the configured session key. The default NullTeamResolver selects no team.

For domain, tenancy-package, or header-based selection, implement:

SetPermissionTeam is a no-op when Spatie teams are disabled. Otherwise it saves the previous team, sets the request team, clears configured loaded user relations, invokes the next middleware, and restores the previous team in finally. This prevents team state leaking between requests in long-running workers.

Development

Related official packages: lean inlayphp/inlay can use native Gate/Policies without this adapter; inlayphp/authorization defines the registry/contract; optional inlayphp/permission-manager provides role, permission, assignment, and audit UI on top of this adapter.


All versions of authorization-spatie with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/auth Version ^12.0 || ^13.0
illuminate/console Version ^12.0 || ^13.0
illuminate/database Version ^12.0 || ^13.0
illuminate/http Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
inlayphp/authorization Version ^0.3 || dev-main
spatie/laravel-permission Version ^6.0 || ^7.0 || ^8.0
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 inlayphp/authorization-spatie contains the following files

Loading the files please wait ...