class BladeCompiler extends Compiler implements CompilerInterface

Traits

Constants

protected RAW_BLOCKS_CONTEXT_KEY

protected FOOTER_CONTEXT_KEY

protected PATH_CONTEXT_KEY

The file currently being compiled.

protected ECHO_FORMAT_CONTEXT_KEY

The "regular" / legacy echo string format.

Properties

protected array<string, callable> $echoHandlers

Custom rendering callbacks for stringable objects.

from  CompilesEchos
protected string|null $lastFragment

The last compiled fragment.

from  CompilesFragments
protected string|null $lastSection

The name of the last section that was started.

from  CompilesLayouts
protected array $extensions

All of the registered extensions.

protected array $customDirectives

All custom "directive" handlers.

protected array $conditions

All custom "condition" handlers.

protected array $prepareStringsForCompilationUsing

The registered string preparation callbacks.

protected array $precompilers

All of the registered precompilers.

protected string $path

Intentionally unset until a path exists so getPath() fails fast.

protected array $compilers

All of the available compiler functions.

protected array $rawTags

Array of opening and closing tags for raw echos.

protected array $contentTags

Array of opening and closing tags for regular echos.

protected array $escapedTags

Array of opening and closing tags for escaped echos.

$footer

Array of footer lines to be added to the template.

protected array $anonymousComponentPaths

The array of anonymous component paths to search for components in.

protected array $anonymousComponentNamespaces

The array of anonymous component namespaces to autoload from.

protected array $classComponentAliases

The array of class component aliases and their class names.

protected array $classComponentNamespaces

The array of class component namespaces to autoload from.

protected bool $compilesComponentTags

Indicates if component tags should be compiled.

protected ComponentTagCompiler $componentTagCompiler

The component tag compiler instance.

protected $template

Methods

__construct($template)

Create a new compiler instance.

string
getCompiledPath(string $path)

Get the path to the compiled version of a view.

from  Compiler
bool
isExpired(string $path)

Determine if the view at the given path is expired.

from  Compiler
void
ensureCompiledDirectoryExists(string $path)

Create the compiled file directory if necessary.

from  Compiler
string
compileCan(string $expression)

Compile the can statements into valid PHP.

string
compileCannot(string $expression)

Compile the cannot statements into valid PHP.

string
compileCanany(string $expression)

Compile the canany statements into valid PHP.

string
compileElsecan(string $expression)

Compile the else-can statements into valid PHP.

string
compileElsecannot(string $expression)

Compile the else-cannot statements into valid PHP.

string
compileElsecanany(string $expression)

Compile the else-canany statements into valid PHP.

string
compileEndcan()

Compile the end-can statements into valid PHP.

string
compileEndcannot()

Compile the end-cannot statements into valid PHP.

string
compileEndcanany()

Compile the end-canany statements into valid PHP.

string
compileClass(string|null $expression)

Compile the conditional class statement into valid PHP.

string
compileComments(string $value)

Compile Blade comments into an empty string.

string
compileComponent(string $expression)

Compile the component statements into valid PHP.

static string
newComponentHash(string $component)

Get a new component hash for a component name.

static string
compileClassComponentOpening(string $component, string $alias, string $data, string $hash)

Compile a class component opening.

string
compileEndComponent()

Compile the end-component statements into valid PHP.

string
compileEndComponentClass()

Compile the end-component statements into valid PHP.

string
popComponentHashStack()

No description

string
compileSlot(string $expression)

Compile the slot statements into valid PHP.

string
compileEndSlot()

Compile the end-slot statements into valid PHP.

string
compileComponentFirst(string $expression)

Compile the component-first statements into valid PHP.

string
compileEndComponentFirst()

Compile the end-component-first statements into valid PHP.

string
compileProps(string $expression)

Compile the prop statement into valid PHP.

string
compileAware(string $expression)

Compile the aware statement into valid PHP.

static mixed
sanitizeComponentAttribute(mixed $value)

Sanitize the given component attribute value.

string
compileAuth(string|null $guard = null)

Compile the if-auth statements into valid PHP.

string
compileElseAuth(string|null $guard = null)

Compile the else-auth statements into valid PHP.

string
compileEndAuth()

Compile the end-auth statements into valid PHP.

string
compileEnv(string $environments)

Compile the env statements into valid PHP.

string
compileEndEnv()

Compile the end-env statements into valid PHP.

string
compileProduction()

Compile the production statements into valid PHP.

string
compileEndProduction()

Compile the end-production statements into valid PHP.

string
compileGuest(string|null $guard = null)

Compile the if-guest statements into valid PHP.

string
compileElseGuest(string|null $guard = null)

Compile the else-guest statements into valid PHP.

string
compileEndGuest()

Compile the end-guest statements into valid PHP.

string
compileHasSection(string $expression)

Compile the has-section statements into valid PHP.

string
compileHasStack(string $expression)

Compile the has-stack statements into valid PHP.

string
compileSectionMissing(string $expression)

Compile the section-missing statements into valid PHP.

string
compileIf(string $expression)

Compile the if statements into valid PHP.

string
compileUnless(string $expression)

Compile the unless statements into valid PHP.

string
compileElseif(string $expression)

Compile the else-if statements into valid PHP.

string
compileElse()

Compile the else statements into valid PHP.

string
compileEndif()

Compile the end-if statements into valid PHP.

string
compileEndunless()

Compile the end-unless statements into valid PHP.

string
compileIsset(string $expression)

Compile the if-isset statements into valid PHP.

string
compileEndIsset()

Compile the end-isset statements into valid PHP.

string
compileSwitch(string $expression)

Compile the switch statements into valid PHP.

string
compileCase(string $expression)

Compile the case statements into valid PHP.

string
compileDefault()

Compile the default statements in switch case into valid PHP.

string
compileEndSwitch()

Compile the end switch statements into valid PHP.

string
compileOnce(string|null $id = null)

Compile a once block into valid PHP.

string
compileEndOnce()

Compile an end-once block into valid PHP.

string
compileBool(string $condition)

Compile a boolean value into a raw true / false value for embedding into HTML attributes or JavaScript.

string
compileChecked(string $condition)

Compile a checked block into valid PHP.

string
compileDisabled(string $condition)

Compile a disabled block into valid PHP.

string
compileRequired(string $condition)

Compile a required block into valid PHP.

string
compileReadonly(string $condition)

Compile a readonly block into valid PHP.

string
compileSelected(string $condition)

Compile a selected block into valid PHP.

string
compilePushIf(string $expression)

Compile the push statements into valid PHP.

string
compileElsePushIf(string $expression)

Compile the else-if push statements into valid PHP.

string
compileElsePush(string $expression)

Compile the else push statements into valid PHP.

string
compileEndPushIf()

Compile the end-push statements into valid PHP.

string
compileContext(string $expression)

Compile the context statements into valid PHP.

string
compileEndcontext()

Compile the endcontext statements into valid PHP.

void
stringable(string|callable $class, callable|null $handler = null)

Add a handler to be executed before echoing a given class.

string
compileEchos(string $value)

Compile Blade echos into valid PHP.

array
getEchoMethods()

Get the echo methods in the proper order for compilation.

string
compileRawEchos(string $value)

Compile the "raw" echo statements.

string
compileRegularEchos(string $value)

Compile the "regular" echo statements.

string
compileEscapedEchos(string $value)

Compile the escaped echo statements.

string
addBladeCompilerVariable(string $result)

Add an instance of the blade echo handler to the start of the compiled string.

string
wrapInEchoHandler(string $value)

Wrap the echoable value in an echo handler if applicable.

mixed
applyEchoHandler(mixed $value)

Apply the echo handler for the value if it exists.

string
compileError(string $expression)

Compile the error statements into valid PHP.

string
compileEnderror()

Compile the enderror statements into valid PHP.

string
compileFragment(string $expression)

Compile the fragment statements into valid PHP.

string
compileEndfragment()

Compile the end-fragment statements into valid PHP.

string
compileCsrf()

Compile the CSRF statements into valid PHP.

string
compileDd(string $arguments)

Compile the "dd" statements into valid PHP.

string
compileDump(string $arguments)

Compile the "dump" statements into valid PHP.

string
compileMethod(string $method)

Compile the method statements into valid PHP.

string
compileVite(string|null $arguments)

Compile the "vite" statements into valid PHP.

string
compileViteReactRefresh()

Compile the "viteReactRefresh" statements into valid PHP.

string
compileFonts(string|null $arguments)

Compile the "fonts" statements into valid PHP.

string
compileEach(string $expression)

Compile the each statements into valid PHP.

string
compileInclude(string $expression)

Compile the include statements into valid PHP.

string
compileIncludeIf(string $expression)

Compile the include-if statements into valid PHP.

string
compileIncludeWhen(string $expression)

Compile the include-when statements into valid PHP.

string
compileIncludeUnless(string $expression)

Compile the include-unless statements into valid PHP.

string
compileIncludeFirst(string $expression)

Compile the include-first statements into valid PHP.

string
compileIncludeIsolated(string $expression)

Compile the include-isolated statements into valid PHP.

string
compileInject(string $expression)

Compile the inject statements into valid PHP.

string
compileJson(string $expression)

Compile the JSON statement into valid PHP.

string
compileJs(string $expression)

Compile the "@js" directive into valid PHP.

string
compileExtends(string $expression)

Compile the extends statements into valid PHP.

string
compileExtendsFirst(string $expression)

Compile the extends-first statements into valid PHP.

string
compileSection(string $expression)

Compile the section statements into valid PHP.

string
compileParent()

Replace the @parent directive to a placeholder.

string
compileYield(string $expression)

Compile the yield statements into valid PHP.

string
compileShow()

Compile the show statements into valid PHP.

string
compileAppend()

Compile the append statements into valid PHP.

string
compileOverwrite()

Compile the overwrite statements into valid PHP.

string
compileStop()

Compile the stop statements into valid PHP.

string
compileEndsection()

Compile the end-section statements into valid PHP.

int
incrementForElseCounter()

No description

int
decrementForElseCounter()

No description

int
getForElseCounter()

No description

string
compileForelse(string|null $expression)

Compile the for-else statements into valid PHP.

string
compileEmpty(string|null $expression)

Compile the for-else-empty and empty statements into valid PHP.

string
compileEndforelse()

Compile the end-for-else statements into valid PHP.

string
compileEndEmpty()

Compile the end-empty statements into valid PHP.

string
compileFor(string $expression)

Compile the for statements into valid PHP.

string
compileForeach(string|null $expression)

Compile the for-each statements into valid PHP.

string
compileBreak(string|null $expression = null)

Compile the break statements into valid PHP.

string
compileContinue(string|null $expression)

Compile the continue statements into valid PHP.

string
compileEndfor()

Compile the end-for statements into valid PHP.

string
compileEndforeach()

Compile the end-for-each statements into valid PHP.

string
compileWhile(string $expression)

Compile the while statements into valid PHP.

string
compileEndwhile()

Compile the end-while statements into valid PHP.

string
compilePhp(string|null $expression)

Compile the raw PHP statements into valid PHP.

string
compileUnset(string $expression)

Compile the unset statements into valid PHP.

string
compileSession(string $expression)

Compile the session statements into valid PHP.

string
compileEndsession()

Compile the endsession statements into valid PHP.

string
compileStack(string $expression)

Compile the stack statements into the content.

string
compilePush(string $expression)

Compile the push statements into valid PHP.

string
compilePushOnce(string $expression)

Compile the push-once statements into valid PHP.

string
compileEndpush()

Compile the end-push statements into valid PHP.

string
compileEndpushOnce()

Compile the end-push-once statements into valid PHP.

string
compilePrepend(string $expression)

Compile the prepend statements into valid PHP.

string
compilePrependOnce(string $expression)

Compile the prepend-once statements into valid PHP.

string
compileEndprepend()

Compile the end-prepend statements into valid PHP.

string
compileEndprependOnce()

Compile the end-prepend-once statements into valid PHP.

string
compileStyle(string|null $expression)

Compile the conditional style statement into valid PHP.

string
compileLang(string|null $expression)

Compile the lang statements into valid PHP.

string
compileEndlang()

Compile the end-lang statements into valid PHP.

string
compileChoice(string $expression)

Compile the choice statements into valid PHP.

string
compileUse(string $expression)

Compile the use statements into valid PHP.

string
firstClosureParameterType(Closure $closure)

Get the class name of the first parameter of the given Closure.

array
firstClosureParameterTypes(Closure $closure)

Get the class names of the first parameter of the given Closure, including union types.

array
closureParameterTypes(Closure $closure)

Get the class names / types of the parameters of the given Closure.

array
closureReturnTypes(Closure $closure)

Get the class names / types of the return type of the given Closure.

void
compile(string|null $path = null)

Compile the view at the given path.

string
appendFilePath(string $contents)

Append the file path to the compiled string.

getOpenAndClosingPhpTokens(string $contents)

Get the open and closing PHP tag tokens from the given string.

string
getPath()

Get the path currently being compiled.

void
setPath(string $path)

Set the path currently being compiled.

string
compileString(string $value)

Compile the given Blade template contents.

render()

No description

Details

at line 309
__construct($template)

Create a new compiler instance.

Parameters

$template

in Compiler at line 33
string getCompiledPath(string $path)

Get the path to the compiled version of a view.

Parameters

string $path

Return Value

string

in Compiler at line 43
bool isExpired(string $path)

Determine if the view at the given path is expired.

Parameters

string $path

Return Value

bool

Exceptions

ErrorException

in Compiler at line 78
protected void ensureCompiledDirectoryExists(string $path)

Create the compiled file directory if necessary.

Parameters

string $path

Return Value

void

protected string compileCan(string $expression)

Compile the can statements into valid PHP.

Parameters

string $expression

Return Value

string

protected string compileCannot(string $expression)

Compile the cannot statements into valid PHP.

Parameters

string $expression

Return Value

string

protected string compileCanany(string $expression)

Compile the canany statements into valid PHP.

Parameters

string $expression

Return Value

string

protected string compileElsecan(string $expression)

Compile the else-can statements into valid PHP.

Parameters

string $expression

Return Value

string

protected string compileElsecannot(string $expression)

Compile the else-cannot statements into valid PHP.

Parameters

string $expression

Return Value

string

protected string compileElsecanany(string $expression)

Compile the else-canany statements into valid PHP.

Parameters

string $expression

Return Value

string

protected string compileEndcan()

Compile the end-can statements into valid PHP.

Return Value

string

protected string compileEndcannot()

Compile the end-cannot statements into valid PHP.

Return Value

string

protected string compileEndcanany()

Compile the end-canany statements into valid PHP.

Return Value

string

in CompilesClasses at line 12
protected string compileClass(string|null $expression)

Compile the conditional class statement into valid PHP.

Parameters

string|null $expression

Return Value

string

in CompilesComments at line 12
protected string compileComments(string $value)

Compile Blade comments into an empty string.

Parameters

string $value

Return Value

string

in CompilesComponents at line 23
protected string compileComponent(string $expression)

Compile the component statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesComponents at line 45
static string newComponentHash(string $component)

Get a new component hash for a component name.

Parameters

string $component

Return Value

string

in CompilesComponents at line 61
static string compileClassComponentOpening(string $component, string $alias, string $data, string $hash)

Compile a class component opening.

Parameters

string $component
string $alias
string $data
string $hash

Return Value

string

in CompilesComponents at line 76
protected string compileEndComponent()

Compile the end-component statements into valid PHP.

Return Value

string

in CompilesComponents at line 84
string compileEndComponentClass()

Compile the end-component statements into valid PHP.

Return Value

string

in CompilesComponents at line 101
protected string popComponentHashStack()

No description

Return Value

string

in CompilesComponents at line 115
protected string compileSlot(string $expression)

Compile the slot statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesComponents at line 123
protected string compileEndSlot()

Compile the end-slot statements into valid PHP.

Return Value

string

in CompilesComponents at line 131
protected string compileComponentFirst(string $expression)

Compile the component-first statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesComponents at line 139
protected string compileEndComponentFirst()

Compile the end-component-first statements into valid PHP.

Return Value

string

in CompilesComponents at line 147
protected string compileProps(string $expression)

Compile the prop statement into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesComponents at line 183
protected string compileAware(string $expression)

Compile the aware statement into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesComponents at line 194
static mixed sanitizeComponentAttribute(mixed $value)

Sanitize the given component attribute value.

Parameters

mixed $value

Return Value

mixed

protected string compileAuth(string|null $guard = null)

Compile the if-auth statements into valid PHP.

Parameters

string|null $guard

Return Value

string

protected string compileElseAuth(string|null $guard = null)

Compile the else-auth statements into valid PHP.

Parameters

string|null $guard

Return Value

string

protected string compileEndAuth()

Compile the end-auth statements into valid PHP.

Return Value

string

protected string compileEnv(string $environments)

Compile the env statements into valid PHP.

Parameters

string $environments

Return Value

string

protected string compileEndEnv()

Compile the end-env statements into valid PHP.

Return Value

string

protected string compileProduction()

Compile the production statements into valid PHP.

Return Value

string

protected string compileEndProduction()

Compile the end-production statements into valid PHP.

Return Value

string

protected string compileGuest(string|null $guard = null)

Compile the if-guest statements into valid PHP.

Parameters

string|null $guard

Return Value

string

protected string compileElseGuest(string|null $guard = null)

Compile the else-guest statements into valid PHP.

Parameters

string|null $guard

Return Value

string

in CompilesConditionals at line 100
protected string compileEndGuest()

Compile the end-guest statements into valid PHP.

Return Value

string

in CompilesConditionals at line 108
protected string compileHasSection(string $expression)

Compile the has-section statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesConditionals at line 116
protected string compileHasStack(string $expression)

Compile the has-stack statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesConditionals at line 124
protected string compileSectionMissing(string $expression)

Compile the section-missing statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesConditionals at line 132
protected string compileIf(string $expression)

Compile the if statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesConditionals at line 140
protected string compileUnless(string $expression)

Compile the unless statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesConditionals at line 148
protected string compileElseif(string $expression)

Compile the else-if statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesConditionals at line 156
protected string compileElse()

Compile the else statements into valid PHP.

Return Value

string

in CompilesConditionals at line 164
protected string compileEndif()

Compile the end-if statements into valid PHP.

Return Value

string

in CompilesConditionals at line 172
protected string compileEndunless()

Compile the end-unless statements into valid PHP.

Return Value

string

in CompilesConditionals at line 180
protected string compileIsset(string $expression)

Compile the if-isset statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesConditionals at line 188
protected string compileEndIsset()

Compile the end-isset statements into valid PHP.

Return Value

string

in CompilesConditionals at line 196
protected string compileSwitch(string $expression)

Compile the switch statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesConditionals at line 206
protected string compileCase(string $expression)

Compile the case statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesConditionals at line 220
protected string compileDefault()

Compile the default statements in switch case into valid PHP.

Return Value

string

in CompilesConditionals at line 228
protected string compileEndSwitch()

Compile the end switch statements into valid PHP.

Return Value

string

in CompilesConditionals at line 236
protected string compileOnce(string|null $id = null)

Compile a once block into valid PHP.

Parameters

string|null $id

Return Value

string

in CompilesConditionals at line 246
string compileEndOnce()

Compile an end-once block into valid PHP.

Return Value

string

in CompilesConditionals at line 254
protected string compileBool(string $condition)

Compile a boolean value into a raw true / false value for embedding into HTML attributes or JavaScript.

Parameters

string $condition

Return Value

string

in CompilesConditionals at line 262
protected string compileChecked(string $condition)

Compile a checked block into valid PHP.

Parameters

string $condition

Return Value

string

in CompilesConditionals at line 270
protected string compileDisabled(string $condition)

Compile a disabled block into valid PHP.

Parameters

string $condition

Return Value

string

in CompilesConditionals at line 278
protected string compileRequired(string $condition)

Compile a required block into valid PHP.

Parameters

string $condition

Return Value

string

in CompilesConditionals at line 286
protected string compileReadonly(string $condition)

Compile a readonly block into valid PHP.

Parameters

string $condition

Return Value

string

in CompilesConditionals at line 294
protected string compileSelected(string $condition)

Compile a selected block into valid PHP.

Parameters

string $condition

Return Value

string

in CompilesConditionals at line 302
protected string compilePushIf(string $expression)

Compile the push statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesConditionals at line 312
protected string compileElsePushIf(string $expression)

Compile the else-if push statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesConditionals at line 322
protected string compileElsePush(string $expression)

Compile the else push statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesConditionals at line 330
protected string compileEndPushIf()

Compile the end-push statements into valid PHP.

Return Value

string

in CompilesContexts at line 12
protected string compileContext(string $expression)

Compile the context statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesContexts at line 25
protected string compileEndcontext()

Compile the endcontext statements into valid PHP.

Return Value

string

in CompilesEchos at line 22
void stringable(string|callable $class, callable|null $handler = null)

Add a handler to be executed before echoing a given class.

Parameters

string|callable $class
callable|null $handler

Return Value

void

in CompilesEchos at line 34
string compileEchos(string $value)

Compile Blade echos into valid PHP.

Parameters

string $value

Return Value

string

in CompilesEchos at line 48
protected array getEchoMethods()

Get the echo methods in the proper order for compilation.

Return Value

array

in CompilesEchos at line 60
protected string compileRawEchos(string $value)

Compile the "raw" echo statements.

Parameters

string $value

Return Value

string

in CompilesEchos at line 78
protected string compileRegularEchos(string $value)

Compile the "regular" echo statements.

Parameters

string $value

Return Value

string

in CompilesEchos at line 96
protected string compileEscapedEchos(string $value)

Compile the escaped echo statements.

Parameters

string $value

Return Value

string

in CompilesEchos at line 114
protected string addBladeCompilerVariable(string $result)

Add an instance of the blade echo handler to the start of the compiled string.

Parameters

string $result

Return Value

string

in CompilesEchos at line 122
protected string wrapInEchoHandler(string $value)

Wrap the echoable value in an echo handler if applicable.

Parameters

string $value

Return Value

string

in CompilesEchos at line 136
mixed applyEchoHandler(mixed $value)

Apply the echo handler for the value if it exists.

Parameters

mixed $value

Return Value

mixed

in CompilesErrors at line 12
protected string compileError(string $expression)

Compile the error statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesErrors at line 26
protected string compileEnderror()

Compile the enderror statements into valid PHP.

Return Value

string

in CompilesFragments at line 17
protected string compileFragment(string $expression)

Compile the fragment statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesFragments at line 27
protected string compileEndfragment()

Compile the end-fragment statements into valid PHP.

Return Value

string

in CompilesHelpers at line 14
protected string compileCsrf()

Compile the CSRF statements into valid PHP.

Return Value

string

in CompilesHelpers at line 22
protected string compileDd(string $arguments)

Compile the "dd" statements into valid PHP.

Parameters

string $arguments

Return Value

string

in CompilesHelpers at line 30
protected string compileDump(string $arguments)

Compile the "dump" statements into valid PHP.

Parameters

string $arguments

Return Value

string

in CompilesHelpers at line 38
protected string compileMethod(string $method)

Compile the method statements into valid PHP.

Parameters

string $method

Return Value

string

in CompilesHelpers at line 46
protected string compileVite(string|null $arguments)

Compile the "vite" statements into valid PHP.

Parameters

string|null $arguments

Return Value

string

in CompilesHelpers at line 58
protected string compileViteReactRefresh()

Compile the "viteReactRefresh" statements into valid PHP.

Return Value

string

in CompilesHelpers at line 68
protected string compileFonts(string|null $arguments)

Compile the "fonts" statements into valid PHP.

Parameters

string|null $arguments

Return Value

string

in CompilesIncludes at line 12
protected string compileEach(string $expression)

Compile the each statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesIncludes at line 20
protected string compileInclude(string $expression)

Compile the include statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesIncludes at line 30
protected string compileIncludeIf(string $expression)

Compile the include-if statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesIncludes at line 40
protected string compileIncludeWhen(string $expression)

Compile the include-when statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesIncludes at line 50
protected string compileIncludeUnless(string $expression)

Compile the include-unless statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesIncludes at line 60
protected string compileIncludeFirst(string $expression)

Compile the include-first statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesIncludes at line 70
protected string compileIncludeIsolated(string $expression)

Compile the include-isolated statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesInjections at line 12
protected string compileInject(string $expression)

Compile the inject statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesJson at line 17
protected string compileJson(string $expression)

Compile the JSON statement into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesJs at line 14
protected string compileJs(string $expression)

Compile the "@js" directive into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesLayouts at line 17
protected string compileExtends(string $expression)

Compile the extends statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesLayouts at line 31
protected string compileExtendsFirst(string $expression)

Compile the extends-first statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesLayouts at line 45
protected string compileSection(string $expression)

Compile the section statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesLayouts at line 55
protected string compileParent()

Replace the @parent directive to a placeholder.

Return Value

string

in CompilesLayouts at line 65
protected string compileYield(string $expression)

Compile the yield statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesLayouts at line 73
protected string compileShow()

Compile the show statements into valid PHP.

Return Value

string

in CompilesLayouts at line 81
protected string compileAppend()

Compile the append statements into valid PHP.

Return Value

string

in CompilesLayouts at line 89
protected string compileOverwrite()

Compile the overwrite statements into valid PHP.

Return Value

string

in CompilesLayouts at line 97
protected string compileStop()

Compile the stop statements into valid PHP.

Return Value

string

in CompilesLayouts at line 105
protected string compileEndsection()

Compile the end-section statements into valid PHP.

Return Value

string

in CompilesLoops at line 17
protected int incrementForElseCounter()

No description

Return Value

int

in CompilesLoops at line 24
protected int decrementForElseCounter()

No description

Return Value

int

in CompilesLoops at line 31
protected int getForElseCounter()

No description

Return Value

int

in CompilesLoops at line 41
protected string compileForelse(string|null $expression)

Compile the for-else statements into valid PHP.

Parameters

string|null $expression

Return Value

string

Exceptions

ViewCompilationException

in CompilesLoops at line 66
protected string compileEmpty(string|null $expression)

Compile the for-else-empty and empty statements into valid PHP.

Parameters

string|null $expression

Return Value

string

in CompilesLoops at line 81
protected string compileEndforelse()

Compile the end-for-else statements into valid PHP.

Return Value

string

in CompilesLoops at line 89
protected string compileEndEmpty()

Compile the end-empty statements into valid PHP.

Return Value

string

in CompilesLoops at line 97
protected string compileFor(string $expression)

Compile the for statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesLoops at line 107
protected string compileForeach(string|null $expression)

Compile the for-each statements into valid PHP.

Parameters

string|null $expression

Return Value

string

Exceptions

ViewCompilationException

in CompilesLoops at line 129
protected string compileBreak(string|null $expression = null)

Compile the break statements into valid PHP.

Parameters

string|null $expression

Return Value

string

in CompilesLoops at line 143
protected string compileContinue(string|null $expression)

Compile the continue statements into valid PHP.

Parameters

string|null $expression

Return Value

string

in CompilesLoops at line 157
protected string compileEndfor()

Compile the end-for statements into valid PHP.

Return Value

string

in CompilesLoops at line 165
protected string compileEndforeach()

Compile the end-for-each statements into valid PHP.

Return Value

string

in CompilesLoops at line 173
protected string compileWhile(string $expression)

Compile the while statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesLoops at line 181
protected string compileEndwhile()

Compile the end-while statements into valid PHP.

Return Value

string

in CompilesRawPhp at line 12
protected string compilePhp(string|null $expression)

Compile the raw PHP statements into valid PHP.

Parameters

string|null $expression

Return Value

string

in CompilesRawPhp at line 24
protected string compileUnset(string $expression)

Compile the unset statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesSessions at line 12
protected string compileSession(string $expression)

Compile the session statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesSessions at line 25
protected string compileEndsession()

Compile the endsession statements into valid PHP.

Return Value

string

in CompilesStacks at line 14
protected string compileStack(string $expression)

Compile the stack statements into the content.

Parameters

string $expression

Return Value

string

in CompilesStacks at line 22
protected string compilePush(string $expression)

Compile the push statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesStacks at line 30
protected string compilePushOnce(string $expression)

Compile the push-once statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesStacks at line 45
protected string compileEndpush()

Compile the end-push statements into valid PHP.

Return Value

string

in CompilesStacks at line 53
protected string compileEndpushOnce()

Compile the end-push-once statements into valid PHP.

Return Value

string

in CompilesStacks at line 61
protected string compilePrepend(string $expression)

Compile the prepend statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesStacks at line 69
protected string compilePrependOnce(string $expression)

Compile the prepend-once statements into valid PHP.

Parameters

string $expression

Return Value

string

in CompilesStacks at line 84
protected string compileEndprepend()

Compile the end-prepend statements into valid PHP.

Return Value

string

in CompilesStacks at line 92
protected string compileEndprependOnce()

Compile the end-prepend-once statements into valid PHP.

Return Value

string

in CompilesStyles at line 12
protected string compileStyle(string|null $expression)

Compile the conditional style statement into valid PHP.

Parameters

string|null $expression

Return Value

string

protected string compileLang(string|null $expression)

Compile the lang statements into valid PHP.

Parameters

string|null $expression

Return Value

string

protected string compileEndlang()

Compile the end-lang statements into valid PHP.

Return Value

string

protected string compileChoice(string $expression)

Compile the choice statements into valid PHP.

Parameters

string $expression

Return Value

string

protected string compileUse(string $expression)

Compile the use statements into valid PHP.

Parameters

string $expression

Return Value

string

in ReflectsClosures at line 25
protected string firstClosureParameterType(Closure $closure)

Get the class name of the first parameter of the given Closure.

Parameters

Closure $closure

Return Value

string

Exceptions

ReflectionException
RuntimeException

in ReflectsClosures at line 48
protected array firstClosureParameterTypes(Closure $closure)

Get the class names of the first parameter of the given Closure, including union types.

Parameters

Closure $closure

Return Value

array

Exceptions

ReflectionException
RuntimeException

in ReflectsClosures at line 74
protected array closureParameterTypes(Closure $closure)

Get the class names / types of the parameters of the given Closure.

Parameters

Closure $closure

Return Value

array

Exceptions

ReflectionException

in ReflectsClosures at line 94
protected array closureReturnTypes(Closure $closure)

Get the class names / types of the return type of the given Closure.

Parameters

Closure $closure

Return Value

array

Exceptions

ReflectionException

at line 159
void compile(string|null $path = null)

Compile the view at the given path.

Parameters

string|null $path

Return Value

void

at line 199
protected string appendFilePath(string $contents)

Append the file path to the compiled string.

Parameters

string $contents

Return Value

string

at line 213
protected Collection getOpenAndClosingPhpTokens(string $contents)

Get the open and closing PHP tag tokens from the given string.

Parameters

string $contents

Return Value

Collection

at line 229
string getPath()

Get the path currently being compiled.

Return Value

string

at line 241
void setPath(string $path)

Set the path currently being compiled.

Parameters

string $path

Return Value

void

at line 249
string compileString(string $value)

Compile the given Blade template contents.

Parameters

string $value

Return Value

string

at line 314
View|Htmlable|Closure|string render()

No description

Return Value

View|Htmlable|Closure|string