mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
29 lines
561 B
PHP
29 lines
561 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
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);
|
|
}
|
|
}
|