This commit is contained in:
44
api/app/Models/Administracao/Gestor.php
Normal file
44
api/app/Models/Administracao/Gestor.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Administracao;
|
||||
|
||||
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
||||
use App\Models\Model;
|
||||
|
||||
class Gestor extends Model
|
||||
{
|
||||
protected $table = 'administracao_gestor';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'usuario_id',
|
||||
];
|
||||
|
||||
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 papeis()
|
||||
{
|
||||
return $this->belongsToMany(Papel::class, 'administracao_gestor_papel', 'gestor_id', 'papel_id')
|
||||
->using(GestorPapel::class)
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
public function permissoes()
|
||||
{
|
||||
return $this->belongsToMany(Permissao::class, 'administracao_gestor_permissao', 'gestor_id', 'permissao_id')
|
||||
->using(GestorPermissao::class)
|
||||
->withTimestamps();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user