Skip to content

Commit

Permalink
Merge pull request #5610 from kennith/adds/directive-include-unless
Browse files Browse the repository at this point in the history
[6.x] Documents includeUnless directive
  • Loading branch information
taylorotwell authored Nov 18, 2019
2 parents cef7fb0 + a4646ac commit 43d5831
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion blade.md
Original file line number Diff line number Diff line change
Expand Up @@ -529,10 +529,14 @@ If you attempt to `@include` a view which does not exist, Laravel will throw an

@includeIf('view.name', ['some' => 'data'])

If you would like to `@include` a view depending on a given boolean condition, you may use the `@includeWhen` directive:
If you would like to `@include` a view if a given boolean expression evaluates to `true`, you may use the `@includeWhen` directive:

@includeWhen($boolean, 'view.name', ['some' => 'data'])

If you would like to `@include` a view if a given boolean expression evaluates to `false`, you may use the `@includeUnless` directive:

@includeUnless($boolean, 'view.name', ['some' => 'data'])

To include the first view that exists from a given array of views, you may use the `includeFirst` directive:

@includeFirst(['custom.admin', 'admin'], ['some' => 'data'])
Expand Down

0 comments on commit 43d5831

Please sign in to comment.