From fbc15e8a0760e6b8f824144863c8a9be98af7ecb Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 9 Sep 2018 22:43:42 -0600 Subject: [PATCH] Update ImportJob model --- app/ImportJob.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/ImportJob.php b/app/ImportJob.php index dc0e1cda..52b1187d 100644 --- a/app/ImportJob.php +++ b/app/ImportJob.php @@ -6,5 +6,19 @@ use Illuminate\Database\Eloquent\Model; class ImportJob extends Model { - // + public function url() + { + return url("/i/import/job/{$this->uuid}/{$this->stage}"); + } + + public function files() + { + return $this->hasMany(ImportData::class, 'job_id'); + } + + public function mediaJson() + { + $path = storage_path("app/$this->media_json"); + return json_decode(file_get_contents($path), true); + } }