浏览代码

Update Place model, add url methods

Daniel Supernault 5 年之前
父节点
当前提交
7e11e4aa44
共有 1 个文件被更改,包括 12 次插入0 次删除
  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();
+	}
 }