Download the PHP package ssntpl/laravel-acl without Composer

On this page you can find all versions of the php package ssntpl/laravel-acl. 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 laravel-acl

Laravel ACL

Laravel ACL is a framework-agnostic access control layer for Laravel 10/11/12 projects. It provides global and resource-scoped roles, explicit ALLOW/DENY permissions, permission implication trees, and cache-friendly lookups that plug straight into your existing Eloquent models through a reusable trait.

Features

Requirements

Installation

  1. (Optional) Publish the config and migrations:

  2. Run the migrations:

Configuration (config/acl.php)

Database schema

Publishing the migration adds:

Table Key columns Purpose
acl_roles name, resource_type, description Defines each role; resource_type is null for global roles.
acl_permissions name, resource_type Defines permissions; names are unique.
acl_role_permissions role_id, permission_id, effect Pivot with ALLOW/DENY effect per permission.
acl_role_assignments subject_type, subject_id, role_id, optional resource_*, expires_at Links a subject (e.g., user) to a role, optionally scoped to a resource, with expiration support.
acl_permissions_implications parent_permission_id, child_permission_id Models permission implication trees (grant parent ⇒ grant child).

Usage

1. Add HasRoles to the authenticatable model

2. Create permissions

Interactive artisan flow:

Programmatically:

3. Create roles and attach permissions

In PHP you can use either syncPermissions() (implicit ALLOW) or syncPermissionsWithEffect():

4. Assign roles

Using the trait:

Using the command (handy for ops/support teams):

5. Check roles & permissions

removeRole($resource = null) deletes an assignment, and calling getRole($resource) returns the underlying Role model instance if one exists and is not expired.

HTTP middleware

Register the middleware aliases in app/Http/Kernel.php:

Usage:

Both middleware assume global assignments (resource is null) when evaluating the authenticated subject.

The authenticated guard’s model must use the HasRoles trait (or at least expose compatible hasRole/getRole methods) because the middleware works directly with Auth::user() without re-querying the database.

Caching & invalidation

Role permissions and implied permission trees are cached per record using the configured TTL. Cache invalidation happens automatically when:

Run a full reset manually with:

Artisan command reference

Command Description
acl:create-permission Create/update a permission and optionally attach implied permissions (supports interactive prompts).
acl:create-role Create a role and assign permissions in one step.
acl:assign-role Attach a role to a subject/resource pair with optional expiration.
acl:cache-reset Flush cached permissions and role lookups.

Support & contributing

PRs are welcome. Please include reproduction steps or tests when reporting/patching bugs.


All versions of laravel-acl with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version ^10.0|^11.0|^12.0|^13.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 ssntpl/laravel-acl contains the following files

Loading the files please wait ...