Explorar el Código

Update Place model, add url methods

Daniel Supernault hace 5 años
padre
commit
7e11e4aa44
Se han modificado 1 ficheros con 12 adiciones y 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');
 		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();
+	}
 }
 }