32 lines
632 B
PHP
32 lines
632 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
|
||
|
|
class Feature extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = [
|
||
|
|
'layer_id', 'name', 'geometry', 'properties', 'template_id', 'progress', 'responsible'
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'geometry' => 'array',
|
||
|
|
'properties' => 'array',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function layer()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Layer::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function template()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(InspectionTemplate::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function inspections()
|
||
|
|
{
|
||
|
|
return $this->hasMany(Inspection::class, 'feature_id');
|
||
|
|
}
|
||
|
|
}
|