W3cubDocs

/Laravel 8

Factory

interface Factory (View source)

Methods

bool exists(string $view)

Determine if a given view exists.

View file(string $path, Arrayable|array $data = [], array $mergeData = [])

Get the evaluated view contents for the given path.

View make(string $view, Arrayable|array $data = [], array $mergeData = [])

Get the evaluated view contents for the given view.

mixed share(array|string $key, mixed $value = null)

Add a piece of shared data to the environment.

array composer(array|string $views, Closure|string $callback)

Register a view composer event.

array creator(array|string $views, Closure|string $callback)

Register a view creator event.

$this addNamespace(string $namespace, string|array $hints)

Add a new namespace to the loader.

$this replaceNamespace(string $namespace, string|array $hints)

Replace the namespace hints for the given namespace.

Details

bool exists(string $view)

Determine if a given view exists.

Parameters

string $view

Return Value

bool

View file(string $path, Arrayable|array $data = [], array $mergeData = [])

Get the evaluated view contents for the given path.

Parameters

string $path
Arrayable|array $data
array $mergeData

Return Value

View

View make(string $view, Arrayable|array $data = [], array $mergeData = [])

Get the evaluated view contents for the given view.

Parameters

string $view
Arrayable|array $data
array $mergeData

Return Value

View

mixed share(array|string $key, mixed $value = null)

Add a piece of shared data to the environment.

Parameters

array|string $key
mixed $value

Return Value

mixed

array composer(array|string $views, Closure|string $callback)

Register a view composer event.

Parameters

array|string $views
Closure|string $callback

Return Value

array

array creator(array|string $views, Closure|string $callback)

Register a view creator event.

Parameters

array|string $views
Closure|string $callback

Return Value

array

$this addNamespace(string $namespace, string|array $hints)

Add a new namespace to the loader.

Parameters

string $namespace
string|array $hints

Return Value

$this

$this replaceNamespace(string $namespace, string|array $hints)

Replace the namespace hints for the given namespace.

Parameters

string $namespace
string|array $hints

Return Value

$this

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Contracts/View/Factory.html