• Stars
    star
    145
  • Rank 254,144 (Top 6 %)
  • Language
    PHP
  • Created almost 8 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🚄A Laravel Admin Package to create a website quickly

Speedy

Introduce

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

中文文档

Install

In your laravel application, execute the following command:

composer require hanson/speedy

add service provider to the app.php:

    'providers' => [
        // Laravel Framework Service Providers...
        //...
    
        // Package Service Providers
        Hanson\Speedy\SpeedyServiceProvider::class,
        // ...
    
        // Application Service Providers
        // ...
    ]

publish resource:

php artisan vendor:publish --provider="Hanson\Speedy\SpeedyServiceProvider"

after that, you might want to change some config about speedy:

// 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

    '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

install speedy:

php artisan speedy:install

create a new admin user

php artisan speedy:admin [email protected] --create

or assign admin to an existing user

php artisan speedy:admin [email protected]

make auth by default

php artisan make:auth

and modify the $redirectTo = '/home' to $redirectTo = /admin in LoginController

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

Menu And Permission

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

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.

    # 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.

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.

Middleware

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

Hanson\Speedy\Http\Controllers\BaseController will add middleware automatic.

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.

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.

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

More Repositories

1

vbot

微信,企微,机器人,企业微信,企微机器人,微信机器人,小红书,聚合聊天,RPA,协议,hook,逆向,worktool,ntwork,群发,自动回复,chatgpt,API对接,稳定防封全语言通用,企业定制/SCRM/SAAS专用
PHP
3,946
star
2

laravel-admin-wechat

laravel admin 的微信扩展包,支持多公众号、多小程序、多微信支付,包含基础接口与后台
PHP
237
star
3

weibot

微博爬虫,模拟登录,数据抓取
PHP
232
star
4

foundation-sdk

To create a sdk easiler!
PHP
218
star
5

face

😀微软小冰检测图片颜值评分接口
PHP
153
star
6

youzan-sdk

👍有赞 SDK
PHP
103
star
7

typecho_material_theme

🎁material style theme for the typecho
PHP
102
star
8

my-vbot

Vbot 运行例子
PHP
96
star
9

img

🖼Image hosting powered by laravel
PHP
90
star
10

ProgressDialog

💿progress dialog for android
Java
66
star
11

rainbow

skin for laravel-admin. Laravel admin 皮肤,让后台更好看
PHP
47
star
12

wepy-template

一个基于 wepy 的小程序开发模板
JavaScript
36
star
13

ngrok-script

A script to run local ngrok client for linux and windows
Shell
33
star
14

wechat-notice

微信消息模板发送
PHP
22
star
15

meituan-sdk

美团 SDK
PHP
22
star
16

laravel-admin-register

laravel-admin 短信注册扩展(支持多个短信服务商)
PHP
21
star
17

laravel-admin-qiniu

Laravel admin 框架的七牛 qiniu 多图上传扩展
PHP
21
star
18

open-taobao-sdk

淘宝开放平台SDK
PHP
19
star
19

aes

a golang library to use aes encrypt easier.
Go
18
star
20

newline-echarts

echarts 换行利器
JavaScript
17
star
21

Data-Structure

Data-Structure for JAVA
Java
17
star
22

laravel-work-exception

使用企业微信通知你的系统异常
PHP
13
star
23

pospal

银豹收银系统 SDK
PHP
13
star
24

wechat-lumen

A wechat Application build on lumen
PHP
12
star
25

wechat-handler

A package to create some base handler for wechat events faster!
PHP
11
star
26

Links_for_Material_Theme

基于hanny的友情链接插件做修改,使其在Material Theme中保持原有风格
PHP
11
star
27

WeworkMsg

全语言通用的企业微信会话存档SDK
Go
11
star
28

gaode-sdk

高德地图 SDK
PHP
8
star
29

Exmail

腾讯企业邮箱API
PHP
8
star
30

wechat-oa

登录微信公众号并可主动发送消息
PHP
7
star
31

weidian-sdk

微店(weidian)的SDK接口包
PHP
6
star
32

crawler

A easy package to crawl a site list and detail
PHP
5
star
33

timeutil

a tool processing time for golang
Go
4
star
34

hertz-starter-kit

基于 hertz 做的脚手架
Go
4
star
35

base-laravel-project

PHP
4
star
36

collection

Go
3
star
37

TextFinder

Go
3
star
38

tuling-sdk

AI response from tuling123.com.
PHP
3
star
39

laravel-learning-note

个人对于laravel的代码、设计解读
PHP
3
star
40

phpstorm-setting

personal phpstorm setting
2
star
41

xcx-template

小程序开发模板
JavaScript
2
star
42

coordinate

PHP
1
star
43

HomePage

A simple navigation website
PHP
1
star
44

mobile-form

Laravel admin 的手机验证码 field 字段
HTML
1
star
45

laravel-admin-alioss

laravel admin ali oss support
PHP
1
star
46

golang-learning

golang 源码学习与解析
1
star