Explorar o código

Update Place model, add url methods

Daniel Supernault %!s(int64=5) %!d(string=hai) anos
pai
achega
7e11e4aa44
Modificáronse 1 ficheiros con 12 adicións e 0 borrados
  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();
+	}
 }