Custom components
Inserting a Blade view into a schema
You may use a "view" component to insert a Blade view into a schema arbitrarily:
use Filament\Schemas\Components\View;
View::make('filament.schemas.components.chart')
This assumes that you have a resources/views/filament/schemas/components/chart.blade.php file.
You may pass data to this view through the viewData() method:
use Filament\Schemas\Components\View;
View::make('filament.schemas.components.chart')
->viewData(['data' => $data])
Rendering the component's child schema
You may pass an array of child schema components to the schema() method of the component:
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Components\View;
View::make('filament.schemas.components.chart')
->schema([
TextInput::make('subtotal'),
TextInput::make('total'),
])
Inside the Blade view, you may render the component's schema() using the $getChildSchema() function:
<div>
{{ $getChildSchema() }}
</div>
Accessing the state of another component in the Blade view
Inside the Blade view, you may access the state of another component in the schema using the $get() function:
<div>
{{ $get('email') }}
</div>
TIP
Unless a form field is reactive, the Blade view will not refresh when the value of the field changes, only when the next user interaction occurs that makes a request to the server. If you need to react to changes in a field's value, it should be live().