Skip to content

Commit

Permalink
add @componentFirst documentation
Browse files Browse the repository at this point in the history
for laravel/framework#28783

I was going to hold off until I had PR'ed `componentWhen` and `componentIf`, but those are proving to be a little more difficult, so getting these docs in now.
  • Loading branch information
browner12 authored and gdebrauwer committed Jun 20, 2019
1 parent 0e5cb4c commit 38182a5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions blade.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ Now, we can inject content into the named slot using the `@slot` directive. Any
You are not allowed to access this resource!
@endcomponent

To use the first view that exists from a given array of views for your component, you may use the `componentFirst` directive:

@componentFirst(['custom.admin', 'admin'])
@slot('title', 'Forbidden')
@endcomponent

#### Passing Additional Data To Components

Sometimes you may need to pass additional data to a component. For this reason, you can pass an array of data as the second argument to the `@component` directive. All of the data will be made available to the component template as variables:
Expand Down

0 comments on commit 38182a5

Please sign in to comment.