diff --git a/classes/UploadStorage.php b/classes/UploadStorage.php index b991911..ccc8c7b 100644 --- a/classes/UploadStorage.php +++ b/classes/UploadStorage.php @@ -22,7 +22,8 @@ class UploadStorage { 'basename' => pathinfo($this->file->getClientOriginalName(), PATHINFO_FILENAME), 'extension' => $this->file->getClientOriginalExtension(), 'tags' => [], - 'aspect_ratio' => $this->data['resAspectRatio'] + 'aspect_ratio' => $this->data['aspectRatio'], + 'min_width' => $this->data['minWidth'] ]); $sourceFile->slugAttributes(); diff --git a/formwidgets/responsiveimage/assets/src/App.vue b/formwidgets/responsiveimage/assets/src/App.vue index bb30251..6243fc3 100644 --- a/formwidgets/responsiveimage/assets/src/App.vue +++ b/formwidgets/responsiveimage/assets/src/App.vue @@ -174,9 +174,8 @@ export default { onSend(file, xhr, formData) { formData.append('extraData', JSON.stringify({ ...this.extraData[file.name], - resAspectRatio: this.cropOptions.aspectRatio + ...this.cropOptions })); - formData.append('resAspectRatio', this.aspectRatio); this.formData.forEach((v) => { formData.append(v.name, v.value); }); diff --git a/models/SourceFile.php b/models/SourceFile.php index 3401cc2..263abfe 100644 --- a/models/SourceFile.php +++ b/models/SourceFile.php @@ -24,7 +24,7 @@ class SourceFile extends Model /** * @var array Fillable fields */ - protected $fillable = ['id', 'basename', 'extension', 'tags', 'slug', 'aspect_ratio']; + protected $fillable = ['id', 'basename', 'extension', 'tags', 'slug', 'aspect_ratio', 'min_width']; public $jsonable = ['tags', 'aspect_ratio']; diff --git a/updates/create_file_attachments_table.php b/updates/create_file_attachments_table.php index 5bc6483..d6b436c 100644 --- a/updates/create_file_attachments_table.php +++ b/updates/create_file_attachments_table.php @@ -16,6 +16,7 @@ class CreateResponsiveFilesTable extends Migration $table->string('extension'); $table->json('tags'); $table->string('aspect_ratio')->nullable(); + $table->integer('min_width')->nullable(); $table->timestamps(); });