Open JoepdeJong opened 1 year ago
Hey @JoepdeJong thanks for providing such detail! 🙏
I always liked forms displayed like that and I think there is a simpler way for you to do that without overriding the CrudPanel
class.
You can create a new create_with_blocks
file, that is a copy of https://github.com/Laravel-Backpack/CRUD/blob/main/src/resources/views/crud/create.blade.php
In your CrudController CreateOperation setup, tell backpack to use this view: $this->crud->setCreateView('path.to.your.view')
You will probably need to create a custom form_content
too https://github.com/Laravel-Backpack/CRUD/blob/main/src/resources/views/crud/form_content.blade.php
And I think you can achieve what you are looking for by creating those two files, without overriding nothing from the core.
Cheers
Hey there @JoepdeJong Probably using an Operation (basically a trait that you add to crud controller)? That and the views would avoid overriding backpack crud panel class. Cheers
Hi everyone,
I have implemented
blocks
, which allow me to split op a crud form over multiple cards/columns using e.g.col-md-6
.The config is similar to
tabs
: add'block'=>'block_name'
to a field. To customize blocks, e.g. styling and title, one can useblockOptions
:At the moment, I implemented this by overwriting the
CrudPanel
class and adding aBlocks
trait. This means that it breaks when these files are updated in Backpack.Do you know if there is any interest in this functionality? In that case, I could clean up my code, fork Backpack, and make a PR. Or are there any other possibilities to extend
CrudPanel
,Fields
, andFieldsProtectedMethods
without editing the backpack core?