Download the PHP package aldozumaran/acl without Composer

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

Acl

Laravel 5.2 Acl

Installation

Add to composer.json

"aldozumaran/acl": "1.*"

Run "composer update"

Add to config/app.php providers

AldoZumaran\Acl\AclServiceProvider::class,

Add to config/app.php aliases

'Acl' => AldoZumaran\Acl\Facades\Acl::class,

Add Middleware in kernel.php

'acl' => \AldoZumaran\Acl\Http\Middleware\AclMiddleware::class,

In User model add this Trait

use AldoZumaran\Acl\Traits\AclUserTrait;
class User extends Authenticatable
{

    use AclUserTrait;

Publish views, Model...

php artisan vendor:publish

Change .env file

CACHE_DRIVER=array

And create acl tables:

/*
    //Optional: use seed (AclTableSeeder)
    // Create default permissions (read, update, create, destroy),
    // Create super-admin role
    // Create test route
    // Create default user
    // Add permissions to default user for test route

Add in database/seeds/DatabaseSeeder.php

    $this->call(AclTableSeeder::class);

Add in database/factories/ModelFactory.php

    $factory->define(App\Models\Acl\Role::class, function (Faker\Generator $faker) {
        return [
            'code' => $faker->word,
            'name' => $faker->name,
            'description' => $faker->paragraph,
        ];
    });
    $factory->define(App\Models\Acl\Permission::class, function (Faker\Generator $faker) {
        return [
            'code' => $faker->word,
            'name' => $faker->name,
            'description' => $faker->paragraph,
        ];
    });
    $factory->define(App\Models\Acl\Section::class, function (Faker\Generator $faker) {
        return [
            'code' => $faker->word,
            'name' => $faker->name,
            'description' => $faker->paragraph,
        ];
    });
    $factory->define(App\Models\Acl\PermissionRoleSection::class, function (Faker\Generator $faker) {
        return [
            'permission_id' => 1,
            'role_id' => 1,
            'section_id' => 1,
        ];
    });
    $factory->define(App\Models\Acl\PermissionSectionUser::class, function (Faker\Generator $faker) {
        return [
            'permission_id' => 1,
            'section_id' => 1,
            'user_id' => 1,
        ];
    });
*/

composer dump-autoload

php artisan migrate --seed

Add ACL routes and test route

Route::group(['middleware' => ['web']], function () {
    \Acl::routes();

    Route::group(['middleware' => ['auth','acl']], function () {
        Route::resource('test/custom','CustomController'); // TEST ROUTE
    });
});

Default Configuration in config/acl.php

//Set your named routes <b>permissions</b> (route actions), defaults are:
'permissions' => [
    'index' => 'read',
    'create' => 'create',
    'store' => 'create',
    'show' => 'read',
    'edit' => 'update',
    'update' => 'update',
    'destroy' => 'destroy',
    'read_update' => ['read','update'],
],

//If permission not exists, redirect to index
'redirect_to_index' => true,

// L5.2 Guard auth
'guard' => 'web',

//Set the auth model namespace
'user' => '\App\User',

//route acl prefix . EX. admin/ set admin
'route_prefix' => '', 

// acl urls
'routes' => [
    'roles' => 'acl/roles',
    'users' => 'acl/users',
    'sections' => 'acl/sections',
    'permissions' => 'acl/permissions',
    'index' => 'acl',
],

// roles with access to acl
'granted_roles' => '', // 'admin' or 'admin,webmaster' or ['admin','webmaster']

// super admin role
'role_admin' => 'super-admin',
'email_admin' => '[email protected]',

// http status error 
'http_status' => 403,

Usage

Go to /acl/ (Default configuration)

This plugin works with named routes

Create a TEST ROUTE controller

php artisan make:controller CustomController --resource

// Route::resource('test/custom','CustomController');

generate test.custom.index, test.custom.create, test.custom.store, ...

Add in Section: /acl/sections (prefix resource controller) or (use AclTableSeeder)

test.custom

Add Permissions in /acl/permissions or (use AclTableSeeder)

read, update, create, destroy

Add Roles in /acl/roles or (use AclTableSeeder)


All versions of acl with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^5.2
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 aldozumaran/acl contains the following files

Loading the files please wait ....