2017 © Pedro Peláez
 

library dash-auth

Dash auth

image

shawnsandy/dash-auth

Dash auth

  • Wednesday, January 24, 2018
  • by shawnsandy
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Dashauth

Dash Auth is simple way to create & manage Bouncer Roles & Abilities., (*1)

Install

Via Composer, (*2)

``` json "repositories": [ { "type": "vcs", "url": "https://github.com/shawnsandy/dash-auth" } ],, (*3)

* Add the package to your `composer.json` file as VCS repository, sorry there is no packagist install just yet.

``` bash
$ composer require shawnsandy/dash-auth
  • From the command prompt run the above to install the package

Usage

Quick Start Laravel 5.5x and greater, (*4)

``` txt SUPER_ADMIN_EMAIL=my_super_admin_here@mysite.me, (*5)

* Add the SUPER_ADMIN_EMAIL to your .env file with the email of the registered user that will act as your super-admin.

``` bash
php artisan vendor:publish --tag=dashauth-config
  • From the console use the --tag option to publish config file

``` php 'roles' => [ 'superadmin' => "Super Admin", 'admin' => "Admin", 'staff' => "Staff", 'editor' => "Editor", 'member' => "Member", ],, (*6)

'abilities' => [
    'assign_roles' => 'Assign Roles',
    'manage_users' => 'Manage Users',
    'manage_posts' => 'Manage Posts',
    'manage_admin' => 'Manage Site',
    'manage_systems' => 'Manage Systems',
],

* Edit the config settings (optional), go to `config/dashauth.php` ``` php Dashauth::routes();
  • Add the default dash routes, open routes\web.php file and add the above

Alt text, (*7)

Setup SuperAdmin Role, (*8)

  • Set the superadmin email in you .env file SUPERADMIN_EMAIL=youremail@you.com
  • Next go to yoursite.com/dashauth and create a super admin
  • Manage \ View privileges yoursite.com/dashauth/privileges

Manage Roles Component, (*9)

Add the manage roles component to application passing the user info $user = User::find(1), (*10)

``` php, (*11)

Manage Roles, (*12)

@component("dashauth::forms.privileges", [ "user" => $user ) ]) @slot('btn_class') button is-link is-large is-uppercase @endslot @endcomponent, (*13)

* Dash auth comes with a simple component to manage roles you can add the component `forms.roles` component to you user record.


![Alt text](/screenshot-manage-ability.jpeg?raw=true)

__Manage Abilities (privileges)__

``` php
 @component('dashauth::components.privileges')
 ```

* Assign and remove abilities to/from using the `dashauth::components.privileges` component.

 __Larvel 5.4x__

Add the service provider to the config/app.php file

``` php
"providers" => [
    ShawnSandy\DashAuth\DashAuthServicesProvider::class,
]

Add the facade to config/app.php file, (*14)

``` php aliases => [ "Dashauth" => ShawnSandy\DashAuth\DashAuthFacade::class, ], (*15)


## Change log Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. ## Testing ``` bash $ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*16)

Security

If you discover any security related issues, please email shawnsandy04@gmail.com instead of using the issue tracker., (*17)

Credits

  • [Shawn Sandy][link-author]
  • [All Contributors][link-contributors]

License

The MIT License (MIT). Please see License File for more information., (*18)

The Versions