Home > Backend Development > PHP Tutorial > Laravel 如何实现 管理员后台权限控制

Laravel 如何实现 管理员后台权限控制

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:44:37
Original
1699 people have browsed it

管理员数据表tb_admin(id,name,pwd)
Laravel如何实现管理员权限控制

控制器

<code class="lang-php">//D:/website/zbphp.com/www/Laravel/Controllers/admin/HomeController.php

namespace admin;
use Illuminate\Support\Facades\Hash;

class HomeController extends BaseController
{

    public function login()
    {
        echo date('Y-m-d H:i:s');
    }
}

</code>
Copy after login
Copy after login

回复内容:

管理员数据表tb_admin(id,name,pwd)
Laravel如何实现管理员权限控制

控制器

<code class="lang-php">//D:/website/zbphp.com/www/Laravel/Controllers/admin/HomeController.php

namespace admin;
use Illuminate\Support\Facades\Hash;

class HomeController extends BaseController
{

    public function login()
    {
        echo date('Y-m-d H:i:s');
    }
}

</code>
Copy after login
Copy after login

可能你需要的是:
https://github.com/mrterryh/Permissions

我觉得这个是你需要的,可以设定一个判断管理员权限的filter。

http://laravel.com/docs/routing#route-filters

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template