mirror of https://github.com/pixelfed/pixelfed
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
863 B
PHP
49 lines
863 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Pixelfed\Snowflake\HasSnowflakePrimary;
|
|
use Storage;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property int $story_id
|
|
* @property string|null $media_path
|
|
* @property \Illuminate\Support\Carbon|null $expires_at
|
|
* @property \Illuminate\Support\Carbon|null $created_at
|
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
|
*/
|
|
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));
|
|
}
|
|
}
|