This commit is contained in:
51
api/app/Models/Cadastro/Feriado/Feriado.php
Normal file
51
api/app/Models/Cadastro/Feriado/Feriado.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Cadastro\Feriado;
|
||||
|
||||
use App\Models\Administracao\Modulo;
|
||||
use App\Models\Cadastro\Feriado\FeriadoTipo;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Feriado extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'cadastro_feriado';
|
||||
|
||||
protected $fillable = [
|
||||
'data',
|
||||
'ano',
|
||||
'mes',
|
||||
'dia',
|
||||
'tipo_id',
|
||||
'observacao'
|
||||
];
|
||||
|
||||
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 tipo()
|
||||
{
|
||||
return $this->belongsTo(FeriadoTipo::class);
|
||||
}
|
||||
|
||||
public function modulos()
|
||||
{
|
||||
return $this->belongsToMany(Modulo::class, 'cadastro_feriado_modulo')->withTimestamps();
|
||||
}
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user