forked from sanjabteam/baloot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCity.php
executable file
·48 lines (41 loc) · 965 Bytes
/
City.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace Baloot\Models;
use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\Model;
/**
* @property string $name name of provice
* @property string $description description about province
* @property int $province_id province id of city
* @property-read string $slug unique slug based on name
*/
class City extends Model
{
use Sluggable;
protected $fillable = [
'name',
'description',
'province_id',
];
protected $with = ['province'];
public $timestamps = false;
/**
* Province of city.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function province()
{
return $this->belongsTo(Province::class);
}
/**
* Sluggable config.
*
* @codeCoverageIgnore
*
* @return array
*/
public function sluggable(): array
{
return ['slug' => ['source' => 'name']];
}
}