Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 1.06 KB

File metadata and controls

31 lines (20 loc) · 1.06 KB

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 UG ❇️