Laravel-Backpack / medialibrary-uploaders

MIT License
9 stars 3 forks source link

[Bug] Allow custom fields to use `withMedia()` macro #2

Closed tabacitu closed 1 year ago

tabacitu commented 1 year ago

We can do that by providing an extra attribute in the macro:

CRUD::field('images')
        ->withMedia([ // customize some or all of the Backpack defaults
            'uploader'   => 'image', // do the same thing as you do for ImageField
            'uploader'   => (function($field, $mediaDefinition) {
                return ImageField::name($field)->definition($mediaDefinition);
            }),
        ]);
pxpm commented 1 year ago

working in #3