45 lines
716 B
PHP
45 lines
716 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class CodeProvince extends Model
|
|
{
|
|
|
|
/**
|
|
* Table name of model
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $table = 'code_province';
|
|
|
|
/**
|
|
* Primary key field name of table
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $primaryKey = 'province_id';
|
|
|
|
/**
|
|
* Additional fields from other connected tables
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $appends = [];
|
|
|
|
/**
|
|
* The attributes that should be hidden for arrays.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $hidden = ['province_id'];
|
|
|
|
|
|
public function city()
|
|
{
|
|
return $this->hasMany('App\CodeCity','province_id','province_id');
|
|
}
|
|
|
|
}
|