From 1a9007428e13f1c1f036f24dc71573e9c99e5d2f Mon Sep 17 00:00:00 2001 From: Cassandre Cantet Date: Mon, 30 Oct 2017 02:42:36 +0100 Subject: [PATCH] Modifications on Delete. Ajout orientation --- .../migrations/2017_10_03_140902_create_associate_images.php | 2 +- src/Model/Image.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/database/migrations/2017_10_03_140902_create_associate_images.php b/database/migrations/2017_10_03_140902_create_associate_images.php index dc342fc..78e76a5 100755 --- a/database/migrations/2017_10_03_140902_create_associate_images.php +++ b/database/migrations/2017_10_03_140902_create_associate_images.php @@ -20,7 +20,7 @@ class CreateAssociateImages extends Migration $table->integer('relation_id'); $table->integer('position')->nullable(); - $table->foreign('image_id')->references('id')->on('images'); + $table->foreign('image_id')->references('id')->on('images')->onDelete('cascade'); }); } diff --git a/src/Model/Image.php b/src/Model/Image.php index 726b422..52e86f5 100755 --- a/src/Model/Image.php +++ b/src/Model/Image.php @@ -124,7 +124,7 @@ class Image extends Model public function setContentAttribute($content) { - $this->_content = app('image')->make($content); + $this->_content = app('image')->make($content)->orientate(); } public function getHashAttribute()