2017 © Pedro Peláez
 

library speedy

A Laravel Admin Package to create a website quickly

image

hanson/speedy

A Laravel Admin Package to create a website quickly

  • Monday, December 25, 2017
  • by hanson
  • Repository
  • 3 Watchers
  • 132 Stars
  • 368 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 0 Open issues
  • 12 Versions
  • 32 % Grown

The README.md

Speedy

Introduce

Speedy is a Laravel admin package build with bootstrap and vue, it contains a sidebar menu , a authentication and a authorization control, (*1)

中文文档, (*2)

Install

In your laravel application, execute the following command:, (*3)

composer require hanson/speedy, (*4)

add service provider to the app.php:, (*5)

    'providers' => [
        // Laravel Framework Service Providers...
        //...

        // Package Service Providers
        Hanson\Speedy\SpeedyServiceProvider::class,
        // ...

        // Application Service Providers
        // ...
    ]

publish resource:, (*6)

php artisan vendor:publish --provider="Hanson\Speedy\SpeedyServiceProvider", (*7)

after that, you might want to change some config about speedy:, (*8)

// config/speedy.php
return [
    'class' => [
        'namespace' => 'App\\Models\\',
        'model' => [
            'role' => 'Role',
            'user' => 'User',
            'permission' => 'Permission',
            'permission_role' => 'PermissionRole',
        ]
    ],

    'table' => [
        'role' => 'role',
        'permission' => 'permission',
        'user' => 'users',
        'permission_role' => 'permission_role',
    ],
    // ...
]

By default, models will be storage to App/Models, and user table is user, or you can modify the config wherever you want, (*9)

    'class' => [
        'namespace' => 'App\\Models\\',
        // 'namespace' => 'App\\', set model namespace as 'App\\'
        // ...
    ],
    'table' => [
        'user' => 'users', 
        // 'user' => 'user',set user table name to users
    ]

if you are using user as your table name, remember to modify the user's migration, (*10)

install speedy:, (*11)

php artisan speedy:install, (*12)

create a new admin user, (*13)

php artisan speedy:admin admin@email.com --create, (*14)

or assign admin to an existing user, (*15)

php artisan speedy:admin admin@email.com, (*16)

make auth by default, (*17)

php artisan make:auth, (*18)

and modify the $redirectTo = '/home' to $redirectTo = /admin in LoginController, (*19)

Start up a built-in development server, with php artisan serve, visit http://localhost:8000/admin., (*20)

Speedy sidebar Menus is a very convenient component, you just need to modify the speedy config and run a command to recreate the menu., (*21)

Speedy Permission is simple, it can't deal with complicated situation. Each single menu have a permission to control it. Which mean whoever can see this menu can access everything in it., (*22)

    # speedy.php
    'menus' => [
        'user' => [
            'display' => 'User',
            'url' => '/admin/user'
        ],
        'role' => [
            'display' => 'Role',
            'url' => '/admin/role'
        ],
        'about' => [
            'display' => 'About HanSon',
            'sub' => [
                'github' => [
                    'display' => 'HanSon\'s Github',
                    'url' => 'https://github.com/hanson',
                    'target' => '_blank'
                ],
                'blog' => [
                    'display' => 'HanSon\'s Blog',
                    'url' => 'http://hanc.cc'
                ]
            ]
        ],
    ]

After modify the menu, run php artisan speedy:menu to recreate the menu and permission., (*23)

Role

Every user has one role. Speedy user admin as a default role and own every permission, even though you modify the menu and run the recreate menu command., (*24)

Middleware

Speedy provider a middleware name speedy.auth in Hanson\Speedy\Http\Middleware\SpeedyAdminMiddleware, every admin route must add it to keep application save., (*25)

Hanson\Speedy\Http\Controllers\BaseController will add middleware automatic., (*26)

protected $permissionName;

public function __construct()
{
    $this->middleware('speedy.auth:' . $this->permissionName);
}

You can make your admin controller extends Hanson\Speedy\Http\Controllers\BaseController and set $permissionName as the menu key., (*27)

Validate

Speedy has separate the validate rule in config/validator, in the controller, you can use method $validator = $this->mustValidate('{model}.{method}'); to validate the data. The error will display as you define by resources/lang/en/attributre., (*28)

View

The blade file will be publish in resources/views/vendor/speedy, and you might want to change the resource link in resources/views/vendor/speedy/layouts/app.blade.php, (*29)

The Versions

25/12 2017

dev-master

9999999-dev

A Laravel Admin Package to create a website quickly

  Sources   Download

MIT

The Development Requires

by Avatar hanson

laravel admin panel

25/12 2017

1.0.7

1.0.7.0

A Laravel Admin Package to create a website quickly

  Sources   Download

MIT

The Development Requires

by Avatar hanson

laravel admin panel

07/04 2017

v1.0.6

1.0.6.0

A Laravel Admin Package to create a website quickly

  Sources   Download

MIT

The Development Requires

by Avatar hanson

laravel admin panel

06/03 2017

v1.0.5

1.0.5.0

A Laravel Admin Package to create a website quickly

  Sources   Download

MIT

The Development Requires

by Avatar hanson

laravel admin panel

06/03 2017

dev-dev

dev-dev

A Laravel Admin Package to create a website quickly

  Sources   Download

MIT

The Development Requires

by Avatar hanson

laravel admin panel

03/03 2017

v1.0.4

1.0.4.0

A Laravel Admin Package to create a website quickly

  Sources   Download

MIT

The Development Requires

by Avatar hanson

laravel admin panel

17/02 2017

v1.0.3

1.0.3.0

A Laravel Admin Package to create a website quickly

  Sources   Download

MIT

The Development Requires

by Avatar hanson

laravel admin panel

14/02 2017

dev-laravel5.1

dev-laravel5.1

A Laravel Admin Package to create a website quickly

  Sources   Download

MIT

The Development Requires

by Avatar hanson

laravel admin panel

14/02 2017

v0.5.1

0.5.1.0

A Laravel Admin Package to create a website quickly

  Sources   Download

MIT

The Development Requires

by Avatar hanson

laravel admin panel

14/02 2017

v1.0.2

1.0.2.0

A Laravel Admin Package to create a website quickly

  Sources   Download

MIT

The Development Requires

by Avatar hanson

laravel admin panel

13/02 2017

v1.0.1

1.0.1.0

A Laravel Admin Package to create a website quickly

  Sources   Download

MIT

The Development Requires

by Avatar hanson

laravel admin panel

13/02 2017

v1.0.0

1.0.0.0

A Laravel Admin Package to create a website quickly

  Sources   Download

MIT

The Development Requires

by Avatar hanson

laravel admin panel