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

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();
}
}