This commit is contained in:
70
api/app/Models/ExameLaboratorial/Jornada/Jornada.php
Normal file
70
api/app/Models/ExameLaboratorial/Jornada/Jornada.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameLaboratorial\Jornada;
|
||||
|
||||
use App\Models\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use App\Models\Cadastro\Estabelecimento\Unidade;
|
||||
use App\Models\ExameLaboratorial\Jornada\TipoJornada;
|
||||
use App\Models\Cadastro\Estabelecimento\Infraestrutura;
|
||||
|
||||
class Jornada extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'exame_laboratorial_jornada';
|
||||
|
||||
protected $fillable = [
|
||||
'unidade_id',
|
||||
'infraestrutura_id',
|
||||
'semana_id',
|
||||
'tipo_id',
|
||||
'vagas',
|
||||
'vagas_app',
|
||||
'laboratorio_prestador_infraestrutura_id',
|
||||
'data',
|
||||
'hora_inicial',
|
||||
'hora_fim',
|
||||
'tempo_atendimento',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'data' => 'datetime:d/m/Y',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'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 unidade()
|
||||
{
|
||||
return $this->belongsTo(Unidade::class);
|
||||
}
|
||||
|
||||
public function infraestrutura()
|
||||
{
|
||||
return $this->belongsTo(Infraestrutura::class);
|
||||
}
|
||||
|
||||
public function tipo()
|
||||
{
|
||||
return $this->belongsTo(TipoJornada::class);
|
||||
}
|
||||
|
||||
public function laboratorioPrestadorInfraestrutura()
|
||||
{
|
||||
return $this->belongsTo(Infraestrutura::class, 'laboratorio_prestador_infraestrutura_id');
|
||||
}
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
19
api/app/Models/ExameLaboratorial/Jornada/SemanaJornada.php
Normal file
19
api/app/Models/ExameLaboratorial/Jornada/SemanaJornada.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameLaboratorial\Jornada;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SemanaJornada extends Model
|
||||
{
|
||||
protected $table = 'exame_laboratorial_jornada_semana';
|
||||
|
||||
protected $fillable = [
|
||||
'nome'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
27
api/app/Models/ExameLaboratorial/Jornada/TipoJornada.php
Normal file
27
api/app/Models/ExameLaboratorial/Jornada/TipoJornada.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ExameLaboratorial\Jornada;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class TipoJornada extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'exame_laboratorial_jornada_tipo';
|
||||
|
||||
protected $fillable = [
|
||||
'nome'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function jornadaExameLaboratorial()
|
||||
{
|
||||
return $this->hasMany(Jornada::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user