File: /var/www/vhost/disk-apps/dev-beg.teky.com.co/app/Form.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Form extends Model
{
use SoftDeletes;
protected $guarded = ['id','deleted_at','created_at','updated_at'];
public function priority()
{
return $this->belongsTo(Priority::class);
}
public function areas()
{
return $this->belongsToMany(Area::class, 'area_forms')->withTimestamps();
}
public function equipment()
{
return $this->belongsToMany(Equipment::class, 'equipment_forms')->withTimestamps();
}
public function fields()
{
return $this->belongsToMany(Field::class, 'form_fields')->with(['field_input','field_value','field_datasource'])->withTimestamps();
}
}