bytescommerce/easy-admin-file-upload-field

Adds a new field to easyAdmin

1.0.1 2025-04-02 09:48 UTC

This package is auto-updated.

Last update: 2025-04-02 09:53:11 UTC


README

BytesCommerce QA Pipeline

Finally upload files via backend of EasyAdmin

Long gone are the times where you cannot easily upload files trough an easy-admin backend CRUD controller!

Now with this little adaption its very easy to implement a file upload field in your EasyAdmin backend.

How to use it

  1. Install the package via composer
composer require bytescommerce/easy-admin-file-upload-field
  1. Add a File Field to your EasyAdmin CRUD controller
use BytesCommerce\FileUploadField\Field\FileField;

yield FileField::new('filename', t('File'))
    ->setBasePath(sprintf('%s', File::BASE_FILE_PATH))
    ->setUploadDir(sprintf('public/%s', File::BASE_FILE_PATH))
    ->setUploadedFileNamePattern('[name].[extension]')
    ->setColumns('col-sm-12 col-md-6');

And you're done.

Proudly presented by Bytes Commerce ❇️