Add phase_id to InspectionTemplate model
This commit is contained in:
@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
|
|
||||||
class InspectionTemplate extends Model
|
class InspectionTemplate extends Model
|
||||||
{
|
{
|
||||||
protected $fillable = ['name', 'description', 'project_id', 'fields'];
|
protected $fillable = ['name', 'description', 'project_id', 'phase_id', 'fields'];
|
||||||
|
|
||||||
protected $casts = ['fields' => 'array'];
|
protected $casts = ['fields' => 'array'];
|
||||||
|
|
||||||
@@ -15,6 +15,11 @@ class InspectionTemplate extends Model
|
|||||||
return $this->belongsTo(Project::class);
|
return $this->belongsTo(Project::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function phase()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Phase::class);
|
||||||
|
}
|
||||||
|
|
||||||
public function inspections()
|
public function inspections()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Inspection::class);
|
return $this->hasMany(Inspection::class);
|
||||||
|
|||||||
Reference in New Issue
Block a user