All checks were successful
Push image to registry / build-image (push) Successful in 5m59s
Still need testing and making proper notifications
39 lines
864 B
PHP
39 lines
864 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Job extends Model
|
|
{
|
|
|
|
protected $fillable = [
|
|
"is_active",
|
|
];
|
|
|
|
protected $casts = [
|
|
"is_active" => "boolean",
|
|
];
|
|
|
|
public function jobInfos()
|
|
{
|
|
return $this->hasMany(JobInfo::class)->with("jobInfoType")->orderBy("created_at");
|
|
}
|
|
|
|
/**
|
|
* Get an associative collection of the job infos with their values
|
|
* @return \Illuminate\Database\Eloquent\Collection<string, string>>
|
|
*/
|
|
public function jobInfosTable() {
|
|
return $this->jobInfos->mapWithKeys(function ($jobInfo) {
|
|
return [$jobInfo->key => $jobInfo->value];
|
|
});
|
|
}
|
|
|
|
public function jobRuns()
|
|
{
|
|
return $this->hasMany(JobRun::class)->orderBy("created_at");
|
|
}
|
|
}
|