@@ -5,6 +5,9 @@ weight: 8
55
66# Extending PhpStorm
77
8+ > ** Note**
9+ > When using Laravel Idea plugin all directives are automatically added.
10+
811You may wish to extend PhpStorm to support Blade Directives of this package.
912
10131 . In PhpStorm, open Preferences, and navigate to ** Languages and Frameworks -> PHP -> Blade**
@@ -16,11 +19,17 @@ You may wish to extend PhpStorm to support Blade Directives of this package.
1619** role**
1720
1821- has parameter = YES
19- - Prefix: ` <?php if(auth()->check() && auth()->user()-> hasRole( `
20- - Suffix: ` )); ?>`
22+ - Prefix: ` <?php if(\\Spatie\\Permission\\PermissionServiceProvider::bladeMethodWrapper(' hasRole', { `
23+ - Suffix: ` })): ?>`
2124
2225--
2326
27+ ** elserole**
28+
29+ - has parameter = YES
30+ - Prefix: ` <?php elseif(\\Spatie\\Permission\\PermissionServiceProvider::bladeMethodWrapper('hasRole', { `
31+ - Suffix: ` })): ?> `
32+
2433** endrole**
2534
2635- has parameter = NO
@@ -32,8 +41,8 @@ You may wish to extend PhpStorm to support Blade Directives of this package.
3241** hasrole**
3342
3443- has parameter = YES
35- - Prefix: ` <?php if(auth()->check() && auth()->user()-> hasRole( `
36- - Suffix: ` )); ?>`
44+ - Prefix: ` <?php if(\\Spatie\\Permission\\PermissionServiceProvider::bladeMethodWrapper(' hasRole', { `
45+ - Suffix: ` })): ?>`
3746
3847--
3948
@@ -48,8 +57,8 @@ You may wish to extend PhpStorm to support Blade Directives of this package.
4857** hasanyrole**
4958
5059- has parameter = YES
51- - Prefix: ` <?php if(auth()->check() && auth()->user()-> hasAnyRole( `
52- - Suffix: ` )); ?>`
60+ - Prefix: ` <?php if(\\Spatie\\Permission\\PermissionServiceProvider::bladeMethodWrapper(' hasAnyRole', { `
61+ - Suffix: ` })): ?>`
5362
5463--
5564
@@ -64,8 +73,8 @@ You may wish to extend PhpStorm to support Blade Directives of this package.
6473** hasallroles**
6574
6675- has parameter = YES
67- - Prefix: ` <?php if(auth()->check() && auth()->user()-> hasAllRoles( `
68- - Suffix: ` )); ?>`
76+ - Prefix: ` <?php if(\\Spatie\\Permission\\PermissionServiceProvider::bladeMethodWrapper(' hasAllRoles', { `
77+ - Suffix: ` })): ?>`
6978
7079--
7180
@@ -80,8 +89,8 @@ You may wish to extend PhpStorm to support Blade Directives of this package.
8089** unlessrole**
8190
8291- has parameter = YES
83- - Prefix: ` <?php if(auth()->check() && !auth()->user()-> hasRole( `
84- - Suffix: ` )); ?>`
92+ - Prefix: ` <?php if(! \\Spatie\\Permission\\PermissionServiceProvider::bladeMethodWrapper(' hasRole', { `
93+ - Suffix: ` })): ?>`
8594
8695--
8796
@@ -92,3 +101,17 @@ You may wish to extend PhpStorm to support Blade Directives of this package.
92101- Suffix: blank
93102
94103--
104+
105+ ** hasexactroles**
106+
107+ - has parameter = YES
108+ - Prefix: ` <?php if(\\Spatie\\Permission\\PermissionServiceProvider::bladeMethodWrapper('hasExactRoles', { `
109+ - Suffix: ` })): ?> `
110+
111+ --
112+
113+ ** endhasexactroles**
114+
115+ - has parameter = NO
116+ - Prefix: blank
117+ - Suffix: blank
0 commit comments