trait InteractsWithViews (View source)

Methods

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

Create a new TestView from the given view.

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

Render the contents of the given Blade template string.

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 TestComponent component(string $componentClass, array $data = [])

Render the given view component.

Parameters

string $componentClass
array $data

Return Value

TestComponent

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