'Create Operation: Set a Layout with a row and two columns in Backpack for Laravel

In the create/update Controller I wanted to Add two fields in only one bootstrap row

The same as the fields "Template" and "Page Name" in:

https://demo.backpackforlaravel.com/admin/page/16/edit

Side by side



Solution 1:[1]

You can use field attributes for that - check our the docs here: https://backpackforlaravel.com/docs/5.x/crud-fields#optional-field-attributes-for-presentation-purposes-1

More specifically in your case, both fields should have:

     'wrapper'   => [ 
        'class'      => 'form-group col-md-6'
     ],

That will make each of them half-size (6/12), and they'll fit on the same row.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 tabacitu