PHPackages                             akunbeben/fortify-role - 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. akunbeben/fortify-role

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

akunbeben/fortify-role
======================

Basic Multi Roles authentication package for Fortify.

v1.0.1(5y ago)65313MITPHPPHP ^7.3|^8.0

Since May 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/akunbeben/fortify-role)[ Packagist](https://packagist.org/packages/akunbeben/fortify-role)[ RSS](/packages/akunbeben-fortify-role/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

[![](https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg)](https://laravel.com)

Fortify Role
============

[](#fortify-role)

Basic Multi Roles authentication package for Fortify.

[![GitHub license](https://camo.githubusercontent.com/2064da5e0c2cd3e103a18ea1dd025973222276b1bcec50dbd645ad62c445a2bb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f616b756e626562656e2f666f72746966792d726f6c653f7374796c653d666f722d7468652d6261646765)](https://github.com/akunbeben/fortify-role/blob/master/LICENSE)[![GitHub Workflow Status](https://camo.githubusercontent.com/9d01bef3098499c31730d7c98a3da448ce805718f0d6f20123927441283a2a21/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f616b756e626562656e2f666f72746966792d726f6c652f74657374733f7374796c653d666f722d7468652d6261646765)](https://github.com/akunbeben/fortify-role)[![GitHub release (latest SemVer)](https://camo.githubusercontent.com/7e0524cbf886d240dca261f386ba68dd1da3633a3b1796dbd505b7430a2333b3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f616b756e626562656e2f666f72746966792d726f6c653f6c6162656c3d76657273696f6e267374796c653d666f722d7468652d6261646765)](https://github.com/akunbeben/fortify-role)

Requirement
-----------

[](#requirement)

- Laravel ^8.x
- Laravel/Fortify ^1.x

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

[](#installation)

I recommended you to install this package only on a fresh project.

Install the package using composer

```
composer require akunbeben/fortify-role

```

Usage
-----

[](#usage)

Before continuing the process, please make sure the `FortifyServiceProvider.php` is registered in `config/app.php`. If it's already registered, you can skip this.

```
'providers' => [
    ...
    App\Providers\FortifyServiceProvider::class,
],
```

Then publish the package's vendor files. It's need `--force` because it will replace the `RedirectIfAuthenticated` middleware.

```
php artisan vendor:publish --provider="Akunbeben\FortifyRole\FortifyRoleServiceProvider" --force

```

And then, add `HasRole` traits to your `User` model.

```
