From 12beede2ba83f540dbdd8d802e674fc1a3a16faf Mon Sep 17 00:00:00 2001 From: Maximilian Graf Schimmelmann Date: Wed, 2 Apr 2025 11:29:17 +0200 Subject: [PATCH] Add readme and adapt composer.json --- README.md | 31 +++++++++++++++++++++++++++++++ composer.json | 6 ++++-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9060c33 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +[![BytesCommerce QA Pipeline](https://github.com/bytes-commerce/easyadmin-file-upload-field/actions/workflows/ci.yaml/badge.svg)](https://github.com/bytes-commerce/easyadmin-file-upload-field/actions/workflows/ci.yaml) + + +### 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 +```bash +composer require bytescommerce/easyadmin-file-upload-field +``` + +2. Add a File Field to your EasyAdmin CRUD controller +```php +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](https://bytescommerce.com) :sparkle: + diff --git a/composer.json b/composer.json index 89e9085..6c5c5f1 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,10 @@ { - "name": "bytescommerce/easyadmin-file-upload-field", + "name": "bytescommerce/easy-admin-file-upload-field", "description": "Adds a new field to easyAdmin", + "keywords": ["easyadmin", "easyadmin-bundle","file-upload", "file-upload-field", "easycorp", "easycorp/easyadmin-bundle"], "type": "symfony-bundle", - "license": "proprietary", + "homepage": "https://github.com/bytes-commerce/easy-admin-file-upload-field", + "license": "MIT", "authors": [ { "name": "Maximilian Graf Schimmelmann",