PHPackages                             fortix/shieldify - 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. fortix/shieldify

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

fortix/shieldify
================

A comprehensive roles and permissions management package for Laravel.

1.0(1y ago)015MITPHPPHP ^7.3|^8.0

Since Jul 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/frankdelacruz/FortixShieldify)[ Packagist](https://packagist.org/packages/fortix/shieldify)[ RSS](/packages/fortix-shieldify/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Shieldify Package for Laravel
=============================

[](#shieldify-package-for-laravel)

Shieldify is a comprehensive Laravel package designed to simplify role, permission, and module management within your application. It offers a fluent, easy-to-use API for attaching permissions to roles, roles to users, and conducting permission checks for user authorization.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Manual Service Provider Registration](#manual-service-provider-registration)
- [Configuration](#configuration)
- [Basic Usage](#basic-usage)
    - [Defining Roles, Permissions, and Modules](#defining-roles-permissions-and-modules)
    - [Assigning Roles to Users](#assigning-roles-to-users)
    - [Grant, Revoke Permissions](#grant-revoke-permissions)
    - [Checking Permissions](#checking-permissions)
- [Middleware](#middleware)
- [Advanced Usage](#advanced-usage)
- [Support](#support)

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

[](#installation)

To install Shieldify, run the following command in your project directory:

`composer require fortix/shieldify`

Manual Service Provider Registration
------------------------------------

[](#manual-service-provider-registration)

If Laravel's package auto-discovery does not automatically register the Shieldify service provider, manually add it to the providers array in your config/app.php file:

```
'providers' => [
    ...
    Fortix\Shieldify\ShieldifyServiceProvider::class,
],

```

- Open the config/app.php
- Look for the aliases array
- Add a new entry for your Shieldify facade like so

    ```
      'aliases' => [
          ...
          'Shieldify' => \Fortix\Shieldify\Facades\ShieldifyFacade::class,
      ],

    ```

### After installation, you may publish the package's assets with:

[](#after-installation-you-may-publish-the-packages-assets-with)

```
php artisan vendor:publish --provider="Fortix\Shieldify\ShieldifyServiceProvider"

```

This command publishes the configuration, migrations, and any other assets necessary for Shieldify to function. Run the migrations to set up the required database tables:

```
php artisan migrate

```

Configuration
-------------

[](#configuration)

The `shieldify.php` configuration file will be located in your config directory after publishing. This file allows you to customize various aspects of Shieldify, including caching behavior for permissions to enhance performance.

```
