From a8b63934e4ab6654d7bda6c196a18f35bf3a4e81 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 13 Aug 2019 01:47:15 -0600 Subject: [PATCH] Update Place model --- app/Place.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/Place.php b/app/Place.php index c7c7d68b..a63c507c 100644 --- a/app/Place.php +++ b/app/Place.php @@ -7,15 +7,8 @@ use Pixelfed\Snowflake\HasSnowflakePrimary; class Place extends Model { - use HasSnowflakePrimary; + protected $visible = ['id', 'name', 'country', 'slug']; - /** - * Indicates if the IDs are auto-incrementing. - * - * @var bool - */ - public $incrementing = false; - public function url() { return url('/discover/places/' . $this->id . '/' . $this->slug); @@ -30,4 +23,9 @@ class Place extends Model { return $this->posts()->count(); } + + public function statuses() + { + return $this->hasMany(Status::class, 'id', 'place_id'); + } }