This commit is contained in:
30
api/app/Models/Cadastro/Fabricante/Fabricante.php
Normal file
30
api/app/Models/Cadastro/Fabricante/Fabricante.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Cadastro\Fabricante;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Fabricante extends Model
|
||||
{
|
||||
protected $table = 'cadastro_fabricante';
|
||||
|
||||
protected $fillable = [
|
||||
'tipo_id',
|
||||
'nome',
|
||||
'cnpj',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function tipo()
|
||||
{
|
||||
return $this->belongsTo(Tipo::class);
|
||||
}
|
||||
}
|
||||
26
api/app/Models/Cadastro/Fabricante/Tipo.php
Normal file
26
api/app/Models/Cadastro/Fabricante/Tipo.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Cadastro\Fabricante;
|
||||
|
||||
use App\Models\Cadastro\Fabricante;
|
||||
use App\Models\Model;
|
||||
|
||||
class Tipo extends Model
|
||||
{
|
||||
protected $table = 'cadastro_fabricante_tipo';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'nome',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function fabricantes()
|
||||
{
|
||||
return $this->hasMany(Fabricante::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user