This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Cadastro\Parametrizacao;
|
||||
|
||||
use App\Models\Cadastro\Estabelecimento\Infraestrutura;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
||||
use App\Models\Model;
|
||||
|
||||
class ParametrizacaoPermissaoUsuario extends Model
|
||||
{
|
||||
protected $table = 'cadastro_parametrizacao_permissao_usuario';
|
||||
|
||||
protected $fillable = [
|
||||
'usuario_id',
|
||||
'infraestrutura_id',
|
||||
'municipe',
|
||||
'provisorio',
|
||||
'outro_municipio',
|
||||
'desbloquear_usuario',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'municipe' => 'boolean',
|
||||
'provisorio' => 'boolean',
|
||||
'outro_municipio' => 'boolean',
|
||||
'desbloquear_usuario' => 'boolean',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function usuario()
|
||||
{
|
||||
return $this->belongsTo(Usuario::class);
|
||||
}
|
||||
|
||||
public function infraestrutura()
|
||||
{
|
||||
return $this->belongsTo(Infraestrutura::class);
|
||||
}
|
||||
|
||||
public function pacienteAbas()
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
ParametrizacaoPacienteAba::class,
|
||||
'cadastro_parametrizacao_permissao_usuario_paciente_aba',
|
||||
'parametrizacao_id',
|
||||
'paciente_aba_id'
|
||||
)
|
||||
->using(ParametrizacaoPermissaoUsuarioPacienteAba::class)
|
||||
->as('permissaoUsuarioPacienteAba')
|
||||
->withTimestamps();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user