2017 © Pedro Peláez
 

library adminable

Admin accounts for Laravel apps

image

airlabs/adminable

Admin accounts for Laravel apps

  • Wednesday, November 1, 2017
  • by airlabs
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

airlabs/adminable

Build Status Maintainability, (*1)

This package provides a scaffold for creating admin accounts., (*2)

Requirements

  • Laravel >= 5.5

Installation

  • Require this package
composer require airlabs/adminable
  • Publish the package configuration and customize (or use defaults).
php artisan vendor:publish --provider="Airlabs\Adminable\AdminableServiceProvider" --tag="config"
  • Run package migrations
php artisan migrate
  • Add a trait to your user model
<?php

namespace App;

use Airlabs\Adminable\Adminable;
...

class User
{
    use Adminable, ...;

    ...
}

Usage

  • Checking if user instance is admin:
$user->isAdmin(); // true or false
  • Creating an admin account via console:
php artisan adminable:create

Follow the prompts:, (*3)

, (*4)

Configuration

This package can be customized. Look at the default config file (that can be published to config/adminable.php):, (*5)

<?php

return [
    'column' => 'is_admin',
    'table' => 'users',
    'model' => 'App\User',
    'required_fields' => [
        'name', 'email'
    ],
    'password_field' => 'password'
];

Blade helper

This packages comes with a blade helper called @admin. It uses a recently added if blade directive so you can also use stuff like elseadmin etc., (*6)

@admin
    You are an admin.
@else
    You are NOT an admin.
@endadmin

The Versions

01/11 2017

dev-master

9999999-dev

Admin accounts for Laravel apps

  Sources   Download

MIT

The Requires

 

The Development Requires

by Krzysztof

01/11 2017

1.0.0

1.0.0.0

Admin accounts for Laravel apps

  Sources   Download

MIT

The Requires

 

The Development Requires

by Krzysztof