From 3b8fe9d574ddd07d41cd65e66e734029a897b8b7 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 10 Nov 2019 17:25:52 -0700 Subject: [PATCH] Update StoryItem model --- app/StoryItem.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/StoryItem.php b/app/StoryItem.php index 263605768..7a87d18ef 100644 --- a/app/StoryItem.php +++ b/app/StoryItem.php @@ -3,10 +3,29 @@ namespace App; use Illuminate\Database\Eloquent\Model; +use Pixelfed\Snowflake\HasSnowflakePrimary; use Storage; class StoryItem extends Model { + use HasSnowflakePrimary; + + /** + * Indicates if the IDs are auto-incrementing. + * + * @var bool + */ + public $incrementing = false; + + /** + * The attributes that should be mutated to dates. + * + * @var array + */ + protected $dates = ['expires_at']; + + protected $visible = ['id']; + public function story() { return $this->belongsTo(Story::class); @@ -14,6 +33,6 @@ class StoryItem extends Model public function url() { - return Storage::url($this->media_path); + return url(Storage::url($this->media_path)); } }