Skip to content

Instantly share code, notes, and snippets.

View ediblemanager's full-sized avatar

Gordon Thomson ediblemanager

  • Dundee
View GitHub Profile
@ediblemanager
ediblemanager / 01_Laravel 5 Simple ACL manager_Readme.md
Created July 25, 2018 21:13 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

use DB;
public function up()
{
//Give the moving column a temporary name:
Schema::table('users', function($table)
{
$table->renameColumn('name', 'name_old');
});