Download the PHP package awesome166/abac without Composer

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

Laravel ABAC - Attribute-Based Access Control Package

A robust ABAC implementation for Laravel providing attribute-based permission management with caching and automatic permission recaching.

Features

Requirements

Installation

  1. Run composer require awesome166/abac.
  2. Publish config: php artisan vendor:publish --tag="config".
  3. Migrate: php artisan migrate.

Run the install command:

Publish everything

php artisan vendor:publish --provider="awesome166\abac\ABACServiceProvider" --tag="config,models,migrations,controllers,middleware,commands"

Publish individual components

php artisan vendor:publish --tag="config" # Config php artisan vendor:publish --tag="models" # Models php artisan vendor:publish --tag="migrations" # Migrations php artisan vendor:publish --tag="controllers" # Migrations

Configuration

Publish the config file (optional):

config/abac.php:

Using Traits

Add the HasPermissions trait to your User model:

This trait provides permission management functionality including:

Usage

Middleware

Protect routes with ABAC middleware:

Gates & Policies

Check permissions in controllers/policies:

Manual Checks

Permission Types

On/Off (on-off):

Read/Write (read-write):

CRUD (crud):

Recaching Permissions

When permissions change:

Account Status Handling

Accounts marked as inactive (is_active = false) automatically receive:

Permission Assignment Example

Models & Relationships

Key models included:

Automatic Recaching

Permissions are automatically recached when:

Additional Examples

Get User's Permissions Through Roles

This snippet retrieves all the permissions associated with the roles assigned to a user. It uses Eloquent's with method to eager load the permissions relationship on the roles model.

Get All Assigned Permissions for an Account

This snippet retrieves all the permissions assigned to a specific account. It uses Eloquent's with method to eager load the permission relationship on the assignedPermissions model.

Check Permission Assignments for a Resource

This snippet checks if a specific permission is assigned to an account by filtering the assignedPermissions relationship based on the account_id.

Auto-Assign Default Role & Account

This snippet automatically assigns new users to the default 'user' account type and 'Customer' role when they are created.

Create Admin User Example

Controller Authorization Example

License

MIT License - See LICENSE for details.


All versions of abac with dependencies

PHP Build Version
Package Version
No informations.
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 awesome166/abac contains the following files

Loading the files please wait ....