$files * @property-read int|null $files_count * @property-read Profile|null $profile * * @method static \Illuminate\Database\Eloquent\Builder|ImportJob newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|ImportJob newQuery() * @method static \Illuminate\Database\Eloquent\Builder|ImportJob query() * @method static \Illuminate\Database\Eloquent\Builder|ImportJob whereCompletedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|ImportJob whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|ImportJob whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|ImportJob whereMediaJson($value) * @method static \Illuminate\Database\Eloquent\Builder|ImportJob whereProfileId($value) * @method static \Illuminate\Database\Eloquent\Builder|ImportJob whereService($value) * @method static \Illuminate\Database\Eloquent\Builder|ImportJob whereStage($value) * @method static \Illuminate\Database\Eloquent\Builder|ImportJob whereStoragePath($value) * @method static \Illuminate\Database\Eloquent\Builder|ImportJob whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|ImportJob whereUuid($value) * * @mixin \Eloquent */ class ImportJob extends Model { public function profile() { return $this->belongsTo(Profile::class, 'profile_id'); } 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); } }