Introduction
You may want to separate your fields into sections, each with a heading and description. To do this, you can use a section component:As well as allowing static values, the make() and description() methods also accept functions to dynamically calculate them. You can inject various utilities into the function as parameters.
make() and description() methods also accept functions to dynamically calculate them. You can inject various utilities into the function as parameters.Learn more about utility injection.
Component
$component
Filament\Schemas\Components\Component
The current component instance.
Get function
$get
Filament\Schemas\Components\Utilities\Get
A function for retrieving values from the current schema data. Validation is not run on form fields.
Livewire
$livewire
Livewire\Component
The Livewire component instance.
Eloquent model FQN
$model
?string<Illuminate\Database\Eloquent\Model>
The Eloquent model FQN for the current schema.
Operation
$operation
string
The current operation being performed by the schema. Usually
create, edit, or view.Eloquent record
$record
?Illuminate\Database\Eloquent\Model
The Eloquent record for the current schema.
Adding an icon to the section’s header
You may add an icon to the section’s header using theicon() method:
As well as allowing a static value, the icon() method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.
icon() method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.Learn more about utility injection.
Component
$component
Filament\Schemas\Components\Component
The current component instance.
Get function
$get
Filament\Schemas\Components\Utilities\Get
A function for retrieving values from the current schema data. Validation is not run on form fields.
Livewire
$livewire
Livewire\Component
The Livewire component instance.
Eloquent model FQN
$model
?string<Illuminate\Database\Eloquent\Model>
The Eloquent model FQN for the current schema.
Operation
$operation
string
The current operation being performed by the schema. Usually
create, edit, or view.Eloquent record
$record
?Illuminate\Database\Eloquent\Model
The Eloquent record for the current schema.
Positioning the heading and description aside
You may use theaside() to align heading & description on the left, and the components inside a card on the right:
As well as allowing a static value, the aside() method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.
aside() method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.Learn more about utility injection.
Component
$component
Filament\Schemas\Components\Component
The current component instance.
Get function
$get
Filament\Schemas\Components\Utilities\Get
A function for retrieving values from the current schema data. Validation is not run on form fields.
Livewire
$livewire
Livewire\Component
The Livewire component instance.
Eloquent model FQN
$model
?string<Illuminate\Database\Eloquent\Model>
The Eloquent model FQN for the current schema.
Operation
$operation
string
The current operation being performed by the schema. Usually
create, edit, or view.Eloquent record
$record
?Illuminate\Database\Eloquent\Model
The Eloquent record for the current schema.
Collapsing sections
Sections may becollapsible() to optionally hide long content:
collapsed() by default:
collapsible() and collapsed() methods accept a boolean value to control if the section should be collapsible and collapsed or not:
As well as allowing static values, the collapsible() and collapsed() methods also accept functions to dynamically calculate it. You can inject various utilities into the function as parameters.
collapsible() and collapsed() methods also accept functions to dynamically calculate it. You can inject various utilities into the function as parameters.Learn more about utility injection.
Component
$component
Filament\Schemas\Components\Component
The current component instance.
Get function
$get
Filament\Schemas\Components\Utilities\Get
A function for retrieving values from the current schema data. Validation is not run on form fields.
Livewire
$livewire
Livewire\Component
The Livewire component instance.
Eloquent model FQN
$model
?string<Illuminate\Database\Eloquent\Model>
The Eloquent model FQN for the current schema.
Operation
$operation
string
The current operation being performed by the schema. Usually
create, edit, or view.Eloquent record
$record
?Illuminate\Database\Eloquent\Model
The Eloquent record for the current schema.
Persisting collapsed sections in the user’s session
You can persist whether a section is collapsed in local storage using thepersistCollapsed() method, so it will remain collapsed when the user refreshes the page:
id() of that section to prevent an ID conflict:
persistCollapsed() method accepts a boolean value to control if the section should persist its collapsed state or not:
As well as allowing static values, the persistCollapsed() and id() methods also accept functions to dynamically calculate them. You can inject various utilities into the function as parameters.
persistCollapsed() and id() methods also accept functions to dynamically calculate them. You can inject various utilities into the function as parameters.Learn more about utility injection.
Component
$component
Filament\Schemas\Components\Component
The current component instance.
Get function
$get
Filament\Schemas\Components\Utilities\Get
A function for retrieving values from the current schema data. Validation is not run on form fields.
Livewire
$livewire
Livewire\Component
The Livewire component instance.
Eloquent model FQN
$model
?string<Illuminate\Database\Eloquent\Model>
The Eloquent model FQN for the current schema.
Operation
$operation
string
The current operation being performed by the schema. Usually
create, edit, or view.Eloquent record
$record
?Illuminate\Database\Eloquent\Model
The Eloquent record for the current schema.
Compact section styling
When nesting sections, you can use a more compact styling:compact() method accepts a boolean value to control if the section should be compact or not:
As well as allowing a static value, the compact() method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.
compact() method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.Learn more about utility injection.
Component
$component
Filament\Schemas\Components\Component
The current component instance.
Get function
$get
Filament\Schemas\Components\Utilities\Get
A function for retrieving values from the current schema data. Validation is not run on form fields.
Livewire
$livewire
Livewire\Component
The Livewire component instance.
Eloquent model FQN
$model
?string<Illuminate\Database\Eloquent\Model>
The Eloquent model FQN for the current schema.
Operation
$operation
string
The current operation being performed by the schema. Usually
create, edit, or view.Eloquent record
$record
?Illuminate\Database\Eloquent\Model
The Eloquent record for the current schema.
Secondary section styling
By default, sections have a contrasting background color, which makes them stand out against a gray background. Secondary styling gives the section a less contrasting background, so it is usually slightly darker. This is a better styling when the background color behind the section is the same color as the default section background color, for example when a section is nested inside another section. Secondary sections can be created using thesecondary() method:
secondary() method accepts a boolean value to control if the section should be secondary or not:
Inserting actions and other components in the header of a section
You may insert actions and any other schema component (usually prime components) into the header of a section by passing an array of components to theafterHeader() method:
As well as allowing a static value, the afterHeader() method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.
afterHeader() method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.Learn more about utility injection.
Component
$component
Filament\Schemas\Components\Component
The current component instance.
Get function
$get
Filament\Schemas\Components\Utilities\Get
A function for retrieving values from the current schema data. Validation is not run on form fields.
Livewire
$livewire
Livewire\Component
The Livewire component instance.
Eloquent model FQN
$model
?string<Illuminate\Database\Eloquent\Model>
The Eloquent model FQN for the current schema.
Operation
$operation
string
The current operation being performed by the schema. Usually
create, edit, or view.Eloquent record
$record
?Illuminate\Database\Eloquent\Model
The Eloquent record for the current schema.
Inserting actions and other components in the footer of a section
You may insert actions and any other schema component (usually prime components) into the footer of a section by passing an array of components to thefooter() method:
As well as allowing a static value, the footer() method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.
footer() method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.Learn more about utility injection.
Component
$component
Filament\Schemas\Components\Component
The current component instance.
Get function
$get
Filament\Schemas\Components\Utilities\Get
A function for retrieving values from the current schema data. Validation is not run on form fields.
Livewire
$livewire
Livewire\Component
The Livewire component instance.
Eloquent model FQN
$model
?string<Illuminate\Database\Eloquent\Model>
The Eloquent model FQN for the current schema.
Operation
$operation
string
The current operation being performed by the schema. Usually
create, edit, or view.Eloquent record
$record
?Illuminate\Database\Eloquent\Model
The Eloquent record for the current schema.
Using grid columns within a section
You may use thecolumns() method to easily create a grid within the section:
As well as allowing a static value, the columns() method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.
columns() method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.Learn more about utility injection.
Component
$component
Filament\Schemas\Components\Component
The current component instance.
Get function
$get
Filament\Schemas\Components\Utilities\Get
A function for retrieving values from the current schema data. Validation is not run on form fields.
Livewire
$livewire
Livewire\Component
The Livewire component instance.
Eloquent model FQN
$model
?string<Illuminate\Database\Eloquent\Model>
The Eloquent model FQN for the current schema.
Operation
$operation
string
The current operation being performed by the schema. Usually
create, edit, or view.Eloquent record
$record
?Illuminate\Database\Eloquent\Model
The Eloquent record for the current schema.