public static function logoUpload(
string $id,
string $label,
string $hint,
string $disk = 's3_documents',
string $directory = '',
int $numberOfAttachments = 1,
bool $downloadable = true,
bool $openable = true,
string $visibility = 'private'
) : FileUpload {
// @todo: Deal with HEIC file format
return FileUpload::make($id)
->label($label)
->disk($disk)
->directory(function () use ($directory) {
$domainName = Domain::getByRequest(request());
return $directory ?: $domainName->getName();
})
->downloadable($downloadable)
->openable($openable)
->visibility($visibility)
->acceptedFileTypes([
'image/jpeg',
'image/png',
])
->uploadingMessage('Please wait...')
->hintIcon('heroicon-m-question-mark-circle', tooltip: $hint)
->helperText('Use a PNG, JPG or JPEG file. Max size 100kb. 5:1 aspect ratio logos are recommended. 750x150px is optimal.')
->maxFiles($numberOfAttachments)
->maxSize(110)
->image()
->imageResizeTargetWidth(750)
->imageResizeTargetHeight(150)
->imageResizeMode('force')
->imageEditor()
->imageEditorMode(2)
->imageEditorAspectRatios(['5:1']);
}
public static function logoUpload(
string $id,
string $label,
string $hint,
string $disk = 's3_documents',
string $directory = '',
int $numberOfAttachments = 1,
bool $downloadable = true,
bool $openable = true,
string $visibility = 'private'
) : FileUpload {
// @todo: Deal with HEIC file format
return FileUpload::make($id)
->label($label)
->disk($disk)
->directory(function () use ($directory) {
$domainName = Domain::getByRequest(request());
return $directory ?: $domainName->getName();
})
->downloadable($downloadable)
->openable($openable)
->visibility($visibility)
->acceptedFileTypes([
'image/jpeg',
'image/png',
])
->uploadingMessage('Please wait...')
->hintIcon('heroicon-m-question-mark-circle', tooltip: $hint)
->helperText('Use a PNG, JPG or JPEG file. Max size 100kb. 5:1 aspect ratio logos are recommended. 750x150px is optimal.')
->maxFiles($numberOfAttachments)
->maxSize(110)
->image()
->imageResizeTargetWidth(750)
->imageResizeTargetHeight(150)
->imageResizeMode('force')
->imageEditor()
->imageEditorMode(2)
->imageEditorAspectRatios(['5:1']);
}