linearsoft/entrust-cli

Provides a console interface to Entrust for Laravel

v0.5.2 2016-06-03 16:04 UTC

This package is not auto-updated.

Last update: 2024-11-23 20:04:29 UTC


README

Provides a console interface to Entrust for Laravel

Currently this package only supports Entrust for Laravel 5.

Requirements

You must have Entrust installed and working before attempting to use Entrust-Cli.

Before using Entrust-Cli you must have the Entrust service provider and alias configured.

'providers' => [
    ...
    Zizaco\Entrust\EntrustServiceProvider::class,
    ...
],
'aliases' => [
    ...
     'Entrust'   => Zizaco\Entrust\EntrustFacade::class,
    ...
],

You must also have the Entrust database tables created.

php artisan entrust:migration
php artisan migrate

Visit the Entrust GitHub for more information on installing and configuring Entrust.

Installation

Install the latest version with

$ composer require linearsoft/entrust-cli

Then in your config/app.php you must add

    LinearSoft\EntrustCli\EntrustCliServiceProvider::class,

to your providers array.

Usage

Entrust-Cli adds the following artisan commands

php artisan list
 ...
 entrust-cli
  entrust-cli:permission:attach  Add a permission to an Entrust role
  entrust-cli:permission:create  Create an Entrust permission
  entrust-cli:permission:delete  Delete an Entrust permission
  entrust-cli:permission:detach  Remove a permission from an Entrust role
  entrust-cli:permission:list    List all Entrust permissions
  entrust-cli:role:attach        Add an Entrust role to a user
  entrust-cli:role:create        Create an Entrust role
  entrust-cli:role:delete        Delete an Entrust role
  entrust-cli:role:detach        Remove an Entrust role from a user
  entrust-cli:role:info          Show details for an Entrust role
  entrust-cli:role:list          List all Entrust role
  
 ...

User Identity

Entrust-Cli does not know for certain what attribute your application uses to lookup user records. By default it will check for an email attribute and then fail-over to a username. If your User model does not use either one of these you must manually specify which attribute to search on:

entrust-cli:role:attach myrole "John Doe" --attr=name
entrust-cli:role:attach myrole 8846811346 --attr=barcode

About

Bugs or features requests

Found a problem or would like a feature submit it via GitHub

License

Entrust-Cli is licensed under the GPLv3 License - see the LICENSE file for details