79 lines
1.8 KiB
PHP
79 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Models\ProntoAtendimento\Atendimento;
|
|
|
|
use App\Models\Model;
|
|
use App\Models\ProntoAtendimento\Raat\RegimeTrabalho;
|
|
use App\Models\ProntoAtendimento\Raat\TipoAcidente;
|
|
use Dyrynda\Database\Support\CascadeSoftDeletes;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Raat extends Model
|
|
{
|
|
use SoftDeletes, CascadeSoftDeletes;
|
|
|
|
protected $table = 'pronto_atendimento_raat';
|
|
|
|
protected $cascadeDeletes = [
|
|
'pareceresMedico'
|
|
];
|
|
|
|
protected $casts = [
|
|
'acidente_data' => 'datetime:Y-m-d',
|
|
'acidente_hora' => 'datetime:H:i'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'faa_id',
|
|
'tipo_formulario_acidente_trabalho',
|
|
'empresa_nome',
|
|
'empresa_ramo_atividade',
|
|
'empresa_endereco',
|
|
'empresa_telefone',
|
|
'acidente_data',
|
|
'acidente_hora',
|
|
'acidente_tipo_id',
|
|
'acidente_local',
|
|
'acidente_descricao',
|
|
'regime_trabalho_id',
|
|
'regime_trabalho_outro'
|
|
];
|
|
|
|
protected $hidden = [
|
|
'created_at',
|
|
'created_lotacao_id',
|
|
'created_centro_custo_id',
|
|
'updated_at',
|
|
'updated_lotacao_id',
|
|
'updated_centro_custo_id',
|
|
'deleted_at',
|
|
'deleted_lotacao_id',
|
|
'deleted_centro_custo_id',
|
|
];
|
|
|
|
public function faa()
|
|
{
|
|
return $this->belongsTo(Faa::class);
|
|
}
|
|
|
|
public function tipoAcidente()
|
|
{
|
|
return $this->belongsTo(TipoAcidente::class, 'acidente_tipo_id');
|
|
}
|
|
|
|
public function regimeTrabalho()
|
|
{
|
|
return $this->belongsTo(RegimeTrabalho::class);
|
|
}
|
|
|
|
public function pareceresMedico()
|
|
{
|
|
return $this->hasMany(RaatParecerMedico::class);
|
|
}
|
|
|
|
public function getIsAllowedToDeleteAttribute()
|
|
{
|
|
return true;
|
|
}
|
|
}
|