class ViewFileHelper

Traits

Properties

protected Container|null $container from  HasContainer

Methods

void
setContainer(Container $container)

Set the container used for resolution.

getContainer()

Return the current container.

mixed
resolve(string $abstract)

Resolve the given type from the container.

__construct(array $viewDirectories, FileHelper $fileHelper, RuntimeInputs $runtimeInputs)

Create a new view file helper instance.

void
trackRootViewDirectories(Scope $scope)

Track the root view directories.

void
trackAllViewDirectories(Scope $scope)

Track every view directory.

getRootViewFilePaths()

Get the view files in the root view directories.

getAllViewFilePaths()

Get the view files in every view directory.

getAllViewNames()

Get the names of the views that can be reported as unused.

array
getViews(string $path)

Get the Blade view files beneath the given directory.

finder()

Get the booted application's view finder.

Details

in HasContainer at line 19
void setContainer(Container $container)

Set the container used for resolution.

Parameters

Container $container

Return Value

void

in HasContainer at line 27
Container getContainer()

Return the current container.

Return Value

Container

in HasContainer at line 35
mixed resolve(string $abstract)

Resolve the given type from the container.

Parameters

string $abstract

Return Value

mixed

at line 65
__construct(array $viewDirectories, FileHelper $fileHelper, RuntimeInputs $runtimeInputs)

Create a new view file helper instance.

Configured directories replace the booted finder's paths and namespace hints for the unused-view rule; the missing-translation rule always scans the finder's paths, as upstream does. Upstream also names the views in namespace hint directories as though they were root views. Those views are only scanned for usages here: framework and package views, such as pagination::tailwind, are rendered by names that no literal call shows.

Parameters

array $viewDirectories
FileHelper $fileHelper
RuntimeInputs $runtimeInputs

at line 99
void trackRootViewDirectories(Scope $scope)

Track the root view directories.

The result cache runs the rule again when a view file in the root view directories changes.

Parameters

Scope $scope

Return Value

void

at line 112
void trackAllViewDirectories(Scope $scope)

Track every view directory.

The result cache runs the rule again when a view file in any of the view directories changes.

Parameters

Scope $scope

Return Value

void

at line 123
Generator getRootViewFilePaths()

Get the view files in the root view directories.

Return Value

Generator

at line 137
Generator getAllViewFilePaths()

Get the view files in every view directory.

Return Value

Generator

at line 151
Generator getAllViewNames()

Get the names of the views that can be reported as unused.

Return Value

Generator

at line 175
protected array getViews(string $path)

Get the Blade view files beneath the given directory.

Parameters

string $path

Return Value

array

at line 195
protected ViewFinderInterface finder()

Get the booted application's view finder.

Return Value

ViewFinderInterface