class BladeMapper (View source)

Properties

protected Factory $factory

The view factory instance.

protected BladeCompiler $bladeCompiler

The Blade compiler instance.

Methods

void
__construct(Factory $factory, BladeCompiler $bladeCompiler)

Create a new Blade mapper instance.

FlattenException
map(FlattenException $exception)

Map cached view paths to their original paths.

string|null
findCompiledView(string $compiledPath)

Find the compiled view file for the given compiled path.

array<string, string>
getKnownPaths()

Get the list of known paths from the compiler engine.

array<string, mixed>
filterViewData(array $data)

Filter out the view data that should not be shown in the exception report.

int
detectLineNumber(string $filename, int $compiledLineNumber)

Detect the line number in the original blade file.

string
compileSourcemap(string $value)

Compile the source map for the given blade file.

string
addEchoLineNumbers(string $value)

Add line numbers to echo statements.

string
addStatementLineNumbers(string $value)

Add line numbers to blade statements.

string
addBladeComponentLineNumbers(string $value)

Add line numbers to blade components.

string
insertLineNumberAtPosition(int $position, string $value)

Insert a line number at the given position.

string
trimEmptyLines(string $value)

Trim empty lines from the given value.

int
findClosestLineNumberMapping(string $map, int $compiledLineNumber)

Find the closest line number mapping in the given source map.

Details

void __construct(Factory $factory, BladeCompiler $bladeCompiler)

Create a new Blade mapper instance.

Parameters

Factory $factory
BladeCompiler $bladeCompiler

Return Value

void

FlattenException map(FlattenException $exception)

Map cached view paths to their original paths.

Parameters

FlattenException $exception

Return Value

FlattenException

protected string|null findCompiledView(string $compiledPath)

Find the compiled view file for the given compiled path.

Parameters

string $compiledPath

Return Value

string|null

protected array<string, string> getKnownPaths()

Get the list of known paths from the compiler engine.

Return Value

array<string, string>

protected array<string, mixed> filterViewData(array $data)

Filter out the view data that should not be shown in the exception report.

Parameters

array $data

Return Value

array<string, mixed>

protected int detectLineNumber(string $filename, int $compiledLineNumber)

Detect the line number in the original blade file.

Parameters

string $filename
int $compiledLineNumber

Return Value

int

protected string compileSourcemap(string $value)

Compile the source map for the given blade file.

Parameters

string $value

Return Value

string

protected string addEchoLineNumbers(string $value)

Add line numbers to echo statements.

Parameters

string $value

Return Value

string

protected string addStatementLineNumbers(string $value)

Add line numbers to blade statements.

Parameters

string $value

Return Value

string

protected string addBladeComponentLineNumbers(string $value)

Add line numbers to blade components.

Parameters

string $value

Return Value

string

protected string insertLineNumberAtPosition(int $position, string $value)

Insert a line number at the given position.

Parameters

int $position
string $value

Return Value

string

protected string trimEmptyLines(string $value)

Trim empty lines from the given value.

Parameters

string $value

Return Value

string

protected int findClosestLineNumberMapping(string $map, int $compiledLineNumber)

Find the closest line number mapping in the given source map.

Parameters

string $map
int $compiledLineNumber

Return Value

int

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.