izica / relations-widgets-for-backpack

Views/widgets for preview laravel relations in laravel backpack
MIT License
28 stars 13 forks source link

Not working on backpack 6.x #15

Open Raimundas7 opened 8 months ago

Raimundas7 commented 8 months ago

Hello, how to enable this work on backpack 6.x version?

GANFI commented 3 months ago

You can pass viewNamespace param with value backpack::widgets

This is example of code

Widget::add([
            'type'           => 'relation_panel',
            'viewNamespace'  => 'backpack::widgets',
            'name'           => 'information',
            'label'          => 'Shipping info',
            'buttons' => false,
            'fields'         => [
                [
                    'label' => 'First name',
                    'name' => 'first_name'
                ],
                [
                    'label' => 'Last name',
                    'name'  => 'last_name',
                ],
                [
                    'label' => 'Shipping address',
                    'name'  => 'shippingAddress',
                ],
            ],
        ])->to('after_content');