W3cubDocs

/Laravel 8

InteractsWithViews

trait InteractsWithViews (View source)

Methods

TestView view(string $view, array $data = [])

Create a new TestView from the given view.

TestView blade(string $template, array $data = [])

Render the contents of the given Blade template string.

TestView component(string $componentClass, array $data = [])

Render the given view component.

$this withViewErrors(array $errors, string $key = 'default')

Populate the shared view error bag with the given errors.

Details

protected TestView view(string $view, array $data = [])

Create a new TestView from the given view.

Parameters

string $view
array $data

Return Value

TestView

protected TestView blade(string $template, array $data = [])

Render the contents of the given Blade template string.

Parameters

string $template
array $data

Return Value

TestView

protected TestView component(string $componentClass, array $data = [])

Render the given view component.

Parameters

string $componentClass
array $data

Return Value

TestView

protected $this withViewErrors(array $errors, string $key = 'default')

Populate the shared view error bag with the given errors.

Parameters

array $errors
string $key

Return Value

$this

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Foundation/Testing/Concerns/InteractsWithViews.html