mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-09 16:24:51 +00:00
41 lines
599 B
PHP
41 lines
599 B
PHP
<?php
|
|
|
|
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 $casts = [
|
|
'expires_at' => 'datetime'
|
|
];
|
|
|
|
protected $visible = ['id'];
|
|
|
|
public function story()
|
|
{
|
|
return $this->belongsTo(Story::class);
|
|
}
|
|
|
|
public function url()
|
|
{
|
|
return url(Storage::url($this->media_path));
|
|
}
|
|
}
|