Add minWidth to source image
This commit is contained in:
parent
bffa99b042
commit
23c1531895
|
@ -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();
|
||||
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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'];
|
||||
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue