Download the PHP package crebs86/acl-laravel without Composer

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

Fisrt register these services.

On a fresh laravel ">=5.5.*" installation.

composer require crebs86/acl-laravel:0.9

Now run codes bellow:

Step 1) Publish views and migrations

php artisan vendor:publish --tag=first --force 

Step 2) Migrate databases and seed

composer dumpautoload
php artisan migrate
php artisan db:seed

Step 3) Publish Classes

php artisan vendor:publish --tag=second --force

Now register middlewares on app/Http/Kernel.php

For protect your controllers insert on:

You may call the middleware method from the controller's constructor.

class MyExemploController extends Controller{
        public function __construct()
        {
            $this->middleware('auth');      //if auth is necessary
            $this->middleware('access');    //if email verification is necessary
            $this->middleware('active');    //if active account is necessary
        }
}

Protecting methods:

Method Acl::can(array|string, boolean);

First parameter: array or string, noo default value; set permissions needed.

Second parameter: boolean; default true. If the method protected require a super administrator user.

use Crebs86\Acl\Facades\Acl;

class MyExempleController extends Controller{

        public function myMethod()
        {
            Acl::can('permission_name', false);
            //continue...
        }

        public function methodRequireSuperAdminUser()
        {
            Acl::can('permission_name', true);  //for require only super-admin users can access the method define second parameter like true
            //continue...
        }

        public function multiPermission()
        {
              Acl::can(['permission_name', 'other_permission'], false);  //for multi permissions set permissions like a array
              //continue...
        }
}

Similarly, you can use the helpers:

class MyExempleController extends Controller{

        public function myMethod()
        {
            have('permission_name', false);
            //continue...
        }

        public function methodRequireSuperAdminUser()
        {
            if(can('permission_name', true)):
                //continue...
            else:
                abort(403,'Access Denied');
            endif    
        }

        public function multiPermission()
        {
              have(['permission_name', 'other_permission'], false);
              //continue...
        }
}

On Blade files

@if(can(['permission_name', 'other_permission'], false))
    <p>You can view this</p>
@else:
    <p>You don't have permission</p>
@endif

After installation

http://localhost/login

E-mail: [email protected]

Password: crebsacl

You should change the email address and pass.

Tanks!

Tanks!


All versions of acl-laravel with dependencies

PHP Build Version
Package Version
Requires illuminate/console Version ~5.5
illuminate/support Version ~5.5
illuminate/cache Version ~5.5
php Version >=7.0.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 crebs86/acl-laravel contains the following files

Loading the files please wait ...