Browse Source

Update Place model, add url methods

Daniel Supernault 5 years ago
parent
commit
7e11e4aa44
1 changed files with 12 additions and 0 deletions
  1. 12 0
      app/Place.php

+ 12 - 0
app/Place.php

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