1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2025-03-04 02:28:08 +00:00
pixelfed/app/StoryItem.php

39 lines
580 B
PHP
Raw Normal View History

2019-01-12 00:43:53 -07:00
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
2019-11-10 17:25:52 -07:00
use Pixelfed\Snowflake\HasSnowflakePrimary;
2019-01-12 13:34:10 -07:00
use Storage;
2019-01-12 00:43:53 -07:00
class StoryItem extends Model
{
2019-11-10 17:25:52 -07:00
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'];
2019-01-12 00:44:51 -07:00
public function story()
{
return $this->belongsTo(Story::class);
}
2019-01-12 13:34:10 -07:00
public function url()
{
2019-11-10 17:25:52 -07:00
return url(Storage::url($this->media_path));
2019-01-12 13:34:10 -07:00
}
2019-01-12 00:43:53 -07:00
}