This commit is contained in:
39
api/app/Models/Intranet/Municipio.php
Normal file
39
api/app/Models/Intranet/Municipio.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Intranet;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Municipio extends Model
|
||||
{
|
||||
protected $connection = 'intranet';
|
||||
|
||||
protected $table = 'cadastro_municipio';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'estado_id',
|
||||
'nome',
|
||||
'ibge',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'estado_id'
|
||||
];
|
||||
|
||||
protected $with = [
|
||||
'estado'
|
||||
];
|
||||
|
||||
public function estado()
|
||||
{
|
||||
return $this->belongsTo(Estado::class);
|
||||
}
|
||||
|
||||
public function logradouros()
|
||||
{
|
||||
return $this->hasMany(Logradouro::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user