demo icon indicating copy to clipboard operation
demo copied to clipboard

Morphto relation setup with examples in demo

Open pxpm opened this issue 3 years ago • 3 comments

pxpm avatar May 04 '22 20:05 pxpm

Hi there!

Could you please provide us with more info about this? Looks like you skipped the title/body.

Thank you!

-- Justin Case The Backpack Robot

request-info[bot] avatar May 04 '22 20:05 request-info[bot]

$this->crud->addField([
                'name' => 'commentable',
                'morphOptions' => [
                    ['App\Models\PetShop\Owner', 'Owners'],
                    ['monster', 'Monsters', [
                        'placeholder' => 'Select a little monster'
                    ]],
                    ['App\Models\PetShop\Pet', 'Pets', [
                        'data_source' => backpack_url('pet-shop/comment/fetch/pets'),
                        'minimum_input_length' => 2,
                        'placeholder' => 'select a fluffy pet'
                    ]],
                ],
            ]);

Just pasting it here as the PR contains only the fluent way.

pxpm avatar Aug 04 '22 14:08 pxpm

Hi @pxpm super great job Pedro, look perfect and work perfect is like magic!

I can achieved list all morph relation here screenshot-backpack test-2022 09 12-15_34_26

On edit everything work as expected screenshot-backpack test-2022 09 12-15_34_50

And i add new relation to Articles and works perfect! screenshot-backpack test-2022 09 12-15_38_14

Super great job.

Cheers

jcastroa87 avatar Sep 12 '22 18:09 jcastroa87