Files
DatBrowser/app/Models/Job.php
Matthias Guillitte e8b9517664
All checks were successful
Push image to registry / build-image (push) Successful in 5m59s
Added Hellcase Battle job
Still need testing and making proper notifications
2025-03-18 19:40:55 +01:00

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");
}
}