PhpStorm Interaction | laravel-permission | Spatie

   [Docs](https://spatie.be/docs)  [Laravel-permission](https://spatie.be/docs/laravel-permission/v6)  Advanced-usage  PhpStorm Interaction

 Version   v7   v6   v5   v4   v3

 Other versions for crawler [v7](https://spatie.be/docs/laravel-permission/v7) [v6](https://spatie.be/docs/laravel-permission/v6) [v5](https://spatie.be/docs/laravel-permission/v5) [v4](https://spatie.be/docs/laravel-permission/v4) [v3](https://spatie.be/docs/laravel-permission/v3)

- [ Introduction ](https://spatie.be/docs/laravel-permission/v6/introduction)
- [ Support us ](https://spatie.be/docs/laravel-permission/v6/support-us)
- [ Prerequisites ](https://spatie.be/docs/laravel-permission/v6/prerequisites)
- [ Installation in Laravel ](https://spatie.be/docs/laravel-permission/v6/installation-laravel)
- [ Installation in Lumen ](https://spatie.be/docs/laravel-permission/v6/installation-lumen)
- [ Upgrading ](https://spatie.be/docs/laravel-permission/v6/upgrading)
- [ Questions and issues ](https://spatie.be/docs/laravel-permission/v6/questions-issues)
- [ Changelog ](https://spatie.be/docs/laravel-permission/v6/changelog)
- [ About us ](https://spatie.be/docs/laravel-permission/v6/about-us)

Basic Usage
-----------

- [ Basic Usage ](https://spatie.be/docs/laravel-permission/v6/basic-usage/basic-usage)
- [ Direct Permissions ](https://spatie.be/docs/laravel-permission/v6/basic-usage/direct-permissions)
- [ Using Permissions via Roles ](https://spatie.be/docs/laravel-permission/v6/basic-usage/role-permissions)
- [ Enums ](https://spatie.be/docs/laravel-permission/v6/basic-usage/enums)
- [ Teams permissions ](https://spatie.be/docs/laravel-permission/v6/basic-usage/teams-permissions)
- [ Wildcard permissions ](https://spatie.be/docs/laravel-permission/v6/basic-usage/wildcard-permissions)
- [ Blade directives ](https://spatie.be/docs/laravel-permission/v6/basic-usage/blade-directives)
- [ Defining a Super-Admin ](https://spatie.be/docs/laravel-permission/v6/basic-usage/super-admin)
- [ Using multiple guards ](https://spatie.be/docs/laravel-permission/v6/basic-usage/multiple-guards)
- [ Artisan Commands ](https://spatie.be/docs/laravel-permission/v6/basic-usage/artisan)
- [ Middleware ](https://spatie.be/docs/laravel-permission/v6/basic-usage/middleware)
- [ Passport Client Credentials Grant usage ](https://spatie.be/docs/laravel-permission/v6/basic-usage/passport)
- [ Example App ](https://spatie.be/docs/laravel-permission/v6/basic-usage/new-app)

Best Practices
--------------

- [ Roles vs Permissions ](https://spatie.be/docs/laravel-permission/v6/best-practices/roles-vs-permissions)
- [ Model Policies ](https://spatie.be/docs/laravel-permission/v6/best-practices/using-policies)
- [ Performance Tips ](https://spatie.be/docs/laravel-permission/v6/best-practices/performance)

Advanced usage
--------------

- [ Testing ](https://spatie.be/docs/laravel-permission/v6/advanced-usage/testing)
- [ Database Seeding ](https://spatie.be/docs/laravel-permission/v6/advanced-usage/seeding)
- [ Exceptions ](https://spatie.be/docs/laravel-permission/v6/advanced-usage/exceptions)
- [ Extending ](https://spatie.be/docs/laravel-permission/v6/advanced-usage/extending)
- [ Cache ](https://spatie.be/docs/laravel-permission/v6/advanced-usage/cache)
- [ Events ](https://spatie.be/docs/laravel-permission/v6/advanced-usage/events)
- [ Custom Permission Check ](https://spatie.be/docs/laravel-permission/v6/advanced-usage/custom-permission-check)
- [ UUID/ULID ](https://spatie.be/docs/laravel-permission/v6/advanced-usage/uuid)
- [ PhpStorm Interaction ](https://spatie.be/docs/laravel-permission/v6/advanced-usage/phpstorm)
- [ Other ](https://spatie.be/docs/laravel-permission/v6/advanced-usage/other)
- [ Timestamps ](https://spatie.be/docs/laravel-permission/v6/advanced-usage/timestamps)
- [ UI Options ](https://spatie.be/docs/laravel-permission/v6/advanced-usage/ui-options)

      You are viewing the documentation for **an older version** of this package. You can check the version you are using with the following command:

 `                                    composer show spatie/laravel-permission                                                                                                                                                                                                                                    `

PhpStorm Interaction
====================

###  On this page

1. [ Extending PhpStorm ](#content-extending-phpstorm)

Extending PhpStorm
--------------------------------------------------------------------------------------------------------------

> **Note**When using Laravel Idea plugin all directives are automatically added.

You may wish to extend PhpStorm to support Blade Directives of this package.

1. In PhpStorm, open Preferences, and navigate to **Languages and Frameworks -&gt; PHP -&gt; Blade**(File | Settings | Languages &amp; Frameworks | PHP | Blade)
2. Uncheck "Use default settings", then click on the `Directives` tab.
3. Add the following new directives for the laravel-permission package:

**role**

- has parameter = YES
- Prefix: ``

\--

**elserole**

- has parameter = YES
- Prefix: ``

**endrole**

- has parameter = NO
- Prefix: blank
- Suffix: blank

\--

**hasrole**

- has parameter = YES
- Prefix: ``

\--

**endhasrole**

- has parameter = NO
- Prefix: blank
- Suffix: blank

\--

**hasanyrole**

- has parameter = YES
- Prefix: ``

\--

**endhasanyrole**

- has parameter = NO
- Prefix: blank
- Suffix: blank

\--

**hasallroles**

- has parameter = YES
- Prefix: ``

\--

**endhasallroles**

- has parameter = NO
- Prefix: blank
- Suffix: blank

\--

**unlessrole**

- has parameter = YES
- Prefix: ``

\--

**endunlessrole**

- has parameter = NO
- Prefix: blank
- Suffix: blank

\--

**hasexactroles**

- has parameter = YES
- Prefix: ``

\--

**endhasexactroles**

- has parameter = NO
- Prefix: blank
- Suffix: blank
