Created
June 3, 2022 15:48
-
-
Save matovu-ronald/1fe50bcbc7b4ee5f37ed8d3c2cc01a0a to your computer and use it in GitHub Desktop.
Filament PHP Two Section Form Snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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