PHPackages                             panoscape/access - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. panoscape/access

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

panoscape/access
================

Role and Permission control for Laravel

1.0.2(9y ago)118MITPHP

Since Nov 22Pushed 9y ago1 watchersCompare

[ Source](https://github.com/seancheung/access)[ Packagist](https://packagist.org/packages/panoscape/access)[ Docs](https://github.com/seancheung/access)[ RSS](/packages/panoscape-access/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (5)Used By (0)

[![Build Status](https://camo.githubusercontent.com/eba2c2cb5bf2d6545aea9f4e6826b9b7d02188ca9b1552e21246f30102aada9f/68747470733a2f2f7472617669732d63692e6f72672f7365616e636865756e672f6163636573732e737667)](https://travis-ci.org/seancheung/access)[![Total Downloads](https://camo.githubusercontent.com/be2f487bfd00b6509cbd65e78bf69a50582fd8c0b87514c1a6c5429df3132d74/68747470733a2f2f706f7365722e707567782e6f72672f70616e6f73636170652f6163636573732f642f746f74616c2e737667)](https://packagist.org/packages/panoscape/access)[![Latest Stable Version](https://camo.githubusercontent.com/93cd15b330bb27dbaa796bef40b34a17ea062890788207b6451d9ed9925c44ed/68747470733a2f2f706f7365722e707567782e6f72672f70616e6f73636170652f6163636573732f762f737461626c652e737667)](https://packagist.org/packages/panoscape/access)[![License](https://camo.githubusercontent.com/6556155818a989e627be417e705da3262388be49152be7b09699f853bd45535e/68747470733a2f2f706f7365722e707567782e6f72672f70616e6f73636170652f6163636573732f6c6963656e73652e737667)](https://packagist.org/packages/panoscape/access)

Access
======

[](#access)

Role and Permission control for Laravel

Installation
------------

[](#installation)

### Composer

[](#composer)

```
composer require panoscape/access
```

### Service provider

[](#service-provider)

> config/app.php

```
'providers' => [
    ...
    Panoscape\Access\AccessServiceProvider::class,
];
```

### Facades

[](#facades)

> config/app.php

```
'aliases' => [
    ...
    'Access' => Panoscape\Access\Facades\Access::class,
];
```

### Permission and Role

[](#permission-and-role)

> config/app.php

```
'aliases' => [
    ...
    'App\Permission' => Panoscape\Access\Permission::class,
    'App\Role' => Panoscape\Access\Role::class,
];
```

### Middleware

[](#middleware)

> app/Http/Kernel.php

```
protected $routeMiddleware = [
  ...
  'access' => \Panoscape\Access\Middleware\VerifyAccess::class,
];
```

### Migration

[](#migration)

```
php artisan vendor:publish --provider="Panoscape\Access\AccessServiceProvider" --tag=migrations
```

Before migrating, you'll need to modify the `users` table in the published migration file to the correct user table used in your application

```
//TODO: user table
$table->foreign('user_id')->references('id')->on('users')
```

Usage
-----

[](#usage)

Add `HasRoles` trait to user model.

```
