970786ae94
git commit "add tours pages, components and show views"
49 lines
758 B
PHP
49 lines
758 B
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class City
|
|
*
|
|
* @property int $id
|
|
* @property int $province_id
|
|
* @property string $name
|
|
* @property Carbon $created_at
|
|
* @property Carbon $updated_at
|
|
*
|
|
* @property Collection|User[] $users
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class City extends Model
|
|
{
|
|
protected $table = 'cities';
|
|
public static $snakeAttributes = false;
|
|
|
|
protected $casts = [
|
|
'provinces' => 'int'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'province_id',
|
|
'name'
|
|
];
|
|
|
|
public function users()
|
|
{
|
|
return $this->hasMany(User::class);
|
|
}
|
|
public function province()
|
|
{
|
|
return $this->hasMany(Province::class);
|
|
}
|
|
}
|