layout

I use a standard layout consisting of a content section and a sidebar, where the sidebar is divided into two grid columns and the left side is reserved for any necessary content for the resource.

I want to make this repeatable and something I can use, perhaps like a pre-built function or a component, and I'm wondering how to do this in Filament. Even though I use snippets to get started, the nested hierarchy is always something I fiddle with when adding inputs to the form.

Here's the code of what I use over and over again, and I would like to save myself some effort as I'm using it in almost every resource I create - is this feasible?

 return $form
            ->schema([
                Grid::make(7)
                    ->schema([
                        // Primary Content Section (Content)
                    ])
                ->columnSpan(5),

                // Metadata Section
                Section::make('Properties')
                            ->label('Metadata')
                            ->schema([
                                Grid::make(2)
                                    ->schema([
                                        // metadata fields here
                                    ]),
                            ])
                            ->columnSpan(2),
                    ]),
            ]);
Was this page helpful?