Adding custom blocks to modules
How do you add custom blocks to modules? Generally i add blocks to a module using $form->add(BlockEditor::make()) within the controller getForm Method. However if i have created a custom block class named EditorBlade and i try to add it like $form->add(EditorBlade::make()) it gives me an error of call to undefined method Editor::make().
2 Replies
hi @.zeenux the
BlockEditor
field has a blocks()
method to specify which blocks are available in that field. If you don't use it all your blocks should be. You can use multiple block editor fields too, by using the name()
method.Thanks. However how do you add a BlockComponent Class? for instance class Editor extends TwillBlockComponent. How would i add it to the Module?