1
0
Fork 0

Update Place model, add url methods

This commit is contained in:
Daniel Supernault 2019-08-29 18:30:26 -06:00
parent a3ae352fd2
commit 7e11e4aa44
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 12 additions and 0 deletions

View File

@ -28,4 +28,16 @@ class Place extends Model
{
return $this->hasMany(Status::class, 'id', 'place_id');
}
public function countryUrl()
{
$country = strtolower($this->country);
$country = urlencode($country);
return url('/discover/location/country/' . $country);
}
public function cityUrl()
{
return $this->url();
}
}