Backpack Media Library

485 Views Asked by At

I am using laravel backpack. I want to open media gallery in backpack when click on browse button. I have added file manager and the images are stored in amazon s3. The images in s3 gallery will open, when click on browse button.
Please help me, how can I open the media gallery?

I have used field type as browse. But, when I select image and trying to save it in amazon s3, it is not saving. Please help me to solve this issue.

My field:

    $this->crud->addField([
        'label'  => "Image",
        'name'   => "image",
        'type'   => 'browse',
        'upload' => true,
        'disk'   => 's3',
    ],
        'both');

My model's mutator method:

public function setImageAttribute($value) {
    $attribute_name = 'image'; 
    $disk = 's3'; 
    $destination_path = '';
    $this->uploadFileToDisk($value, $attribute_name, $disk, $destination_path);
}
0

There are 0 best solutions below