document view first

This commit is contained in:
Taylor Otwell 2017-09-14 08:33:01 -05:00
parent 591c067947
commit 6c1fa45303
1 changed files with 12 additions and 0 deletions

View File

@ -42,6 +42,18 @@ If you need to determine if a view exists, you may use the `View` facade. The `e
//
}
#### Creating The First Available View
Using the `first` method, you may create the first view that exists in a given array of views. This is useful if your application or package allows views to be customized or overwritten:
return view()->first(['custom.admin', 'admin'], $data);
Of course, you may also call this method via the `View` [facade](/docs/{{version}}/facades):
use Illuminate\Support\Facades\View;
return View::first(['custom.admin', 'admin'], $data);
<a name="passing-data-to-views"></a>
## Passing Data To Views