23 lines
425 B
PHP
23 lines
425 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
|
||
|
|
class InspectionTemplate extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = ['name', 'description', 'project_id', 'fields'];
|
||
|
|
|
||
|
|
protected $casts = ['fields' => 'array'];
|
||
|
|
|
||
|
|
public function project()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Project::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function inspections()
|
||
|
|
{
|
||
|
|
return $this->hasMany(Inspection::class);
|
||
|
|
}
|
||
|
|
}
|