Component
Properties
$except array
The properties / methods that should not be exposed to the component.
$componentName string
The component alias name.
$componentsResolver callable|null
The component resolver callback.
$bladeViewCache
array
The cache of blade view names, keyed by contents.
$propertyCache array
The cache of public property names, keyed by class.
$methodCache array
The cache of public method names, keyed by class.
$constructorParametersCache
array>
The cache of constructor parameters, keyed by class.
Methods
render ( ) : View |Htmlable |Closure |string
Get the view / view contents that represent the component.
resolve ( $data ) : static
Resolve the component instance with the given data.
Parameters
- $data array
extractConstructorParameters ( ) : array
Extract the constructor parameters for the component.
resolveView ( ) : View |Htmlable |Closure |string
Resolve the Blade view or view file that should be used when rendering the component.
extractBladeViewFromString ( $contents ) : string
Create a Blade view with the raw component string content.
Parameters
- $contents string
createBladeViewFromString ( $factory , $contents ) : string
Create a Blade view with the raw component string content.
Parameters
- $factory Factory
- $contents string
data ( ) : array
Get the data that should be supplied to the view.
extractPublicProperties ( ) : array
Extract the public properties for the component.
extractPublicMethods ( ) : array
Extract the public methods for the component.
createVariableFromMethod ( ReflectionMethod $method ) : mixed
Create a callable variable from the given method.
Parameters
- $method ReflectionMethod
createInvokableVariable ( string $method ) : InvokableComponentVariable
Create an invokable, toStringable variable for the given component method.
Parameters
- $method string
shouldIgnore ( $name ) : bool
Determine if the given property / method should be ignored.
Parameters
- $name string
ignoredMethods ( ) : array
Get the methods that should be ignored.
withName ( $name ) : $this
Set the component alias name.
Parameters
- $name string
withAttributes ( array $attributes ) : $this
Set the extra attributes that the component should make available.
Parameters
- $attributes array
newAttributeBag ( array $attributes ) : ComponentAttributeBag
Get a new attribute bag instance.
Parameters
- $attributes array
shouldRender ( ) : bool
Determine if the component should be rendered.
view ( $view , $data , $mergeData ) : View
Get the evaluated view contents for the given view.
Parameters
- $view string|null
- $data Illuminate\...\Arrayable|array
- $mergeData array
flushCache ( ) : void
Flush the component's cached state.
forgetFactory ( ) : void
Forget the component's factory instance.
forgetComponentsResolver ( ) : void
Forget the component's resolver callback.
resolveComponentsUsing ( $resolver ) : void
Set the callback that should be used to resolve components within views.
Parameters
-
$
Closure
Component $resolver