Closed aeq-dev closed 7 months ago
I just implemented this the way the core team did for the "Spatie Settings" package. I think of it as a sensible default but am of course open for discussion.
If you have a field inside the form it spans 1 column by default:
public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('test'),
]);
}
Now if you want to make it occupy the whole page, you can just add ->columnSpan(2)
to it.
public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('test')
->columnSpan(2),
]);
}
You can then also add a Layout around it which spans 2 columns and offers a single column to the children:
public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Grid::make(1)
->schema([
Forms\Components\TextInput::make('test'),
])
->columnSpan(2),
]);
}
Let me know if this solves your issue :)
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
What happened?
I checked ModelSettingsPage page and I found this piece of code:
Why did you set columns to 2? how can we update it to fit the page width ?
How to reproduce the bug
-
Package Version
1.0.1
PHP Version
8.2
Laravel Version
10.x
Which operating systems does with happen with?
Linux
Notes
No response