Billie/app/Models/NodeJS/ProjectExecutionStep.php
Billiefi 0f48ed400f fix
2025-05-06 10:25:09 +07:00

43 lines
808 B
PHP

<?php
namespace App\Models\NodeJS;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ProjectExecutionStep extends Model
{
use HasFactory;
protected $fillable = [
'project_id',
'execution_step_id',
'order',
'variables',
];
protected $casts = [
'variables' => 'array',
];
public function getVariablesAttribute($value)
{
return json_decode($value);
}
public function setVariablesAttribute($value)
{
$this->attributes['variables'] = json_encode($value);
}
public function project()
{
return $this->belongsTo(Project::class);
}
public function executionStep()
{
return $this->belongsTo(ExecutionStep::class);
}
}