Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

DoeJohn's avatar

@canany or @canevery ? [Laravel 5.6]

There is @can Blade directive, but it accepts only one string (one ability). But what about checking multiple permissions at once? Is there something like:

@canany(['create_posts', 'edit_posts', 'delete_posts']) - checks if any one of specified abilities passes

or

@canevery(['create_posts', 'edit_posts', 'delete_posts']) - checks if every ability passes

?

I'm using Laravel 5.6

0 likes
4 replies
DoeJohn's avatar

Cool! I did composer update and now it works.

One question: I'm using PhpStorm 2018.1.3 (+ Laravel plugin + IDE Helper) and it does not recognize @canany in Blade files. I know that it is a new feature, but is there any way to make my PhpStorm recognize and suggest it?

Cronix's avatar

@DoeJohn Make sure the "Blade Support" plugin is installed/enabled.

Then you'd go to preferences/Languages & Frameworks/PHP/Blade

There's a panel to add blade directives, if @canany isn't already there.

1 like

Please or to participate in this conversation.