setFieldBlob

setFieldBlob(string $fieldName, string $filenameField, string $temporaryUploadDirectory, string $maxUploadSize)

Enable the upload functionality for Blob field type. For example: BLOB, MEDIUMBLOB,... e.t.c.

For example:

$crud->setFieldBlob('my_blob', 'blob_filename',  'application/private/tmp', '2M');

Example



use GroceryCrud\Core\Helpers\BlobFieldTypeHelper;
...

$crud->setTable('customers');
$crud->setSubject('Customer', 'Customers');
$crud->columns(['customerName','phone','addressLine1','creditLimit', 'image']);

// You will need to make sure that you unset the image_filename field as this is not an editable field
$crud->unsetFields(['image_filename']);
$crud->unsetColumns(['image_filename']);
$crud->setFieldBlob('image', 'image_filename', 'application/private/tmp', BlobFieldTypeHelper::getFilesizeFromFieldType('MEDIUMBLOB'));

$output = $crud->render();