Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save matovu-ronald/1fe50bcbc7b4ee5f37ed8d3c2cc01a0a to your computer and use it in GitHub Desktop.
Save matovu-ronald/1fe50bcbc7b4ee5f37ed8d3c2cc01a0a to your computer and use it in GitHub Desktop.
Filament PHP Two Section Form Snippet
return $form
->schema([
Forms\Components\Group::make()
->schema([
// Enter form fields/cards here
Forms\Components\Card::make()
->schema([
// Enter form fields here
Forms\Components\TextInput::make('number')
->default('OR-' . random_int(100000, 999999))
->disabled()
->required(),
//
Forms\Components\MarkdownEditor::make('notes')
->columnSpan([
'sm' => 2,
]),
])->columns([
'sm' => 2,
]),
Forms\Components\Card::make()
->schema([
Forms\Components\Placeholder::make('Items'),
//
]),
])
->columnSpan([
'sm' => 2,
]),
Forms\Components\Card::make()
->schema([
Forms\Components\Placeholder::make('created_at')
->label('Created at'),
Forms\Components\Placeholder::make('updated_at')
->label('Last modified at')
])
->columnSpan(1),
])
->columns([
'sm' => 3,
'lg' => null,
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment