mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update StoryItem model
This commit is contained in:
parent
6a81f161fa
commit
3b8fe9d574
1 changed files with 20 additions and 1 deletions
|
@ -3,10 +3,29 @@
|
||||||
namespace App;
|
namespace App;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Pixelfed\Snowflake\HasSnowflakePrimary;
|
||||||
use Storage;
|
use Storage;
|
||||||
|
|
||||||
class StoryItem extends Model
|
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()
|
public function story()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Story::class);
|
return $this->belongsTo(Story::class);
|
||||||
|
@ -14,6 +33,6 @@ class StoryItem extends Model
|
||||||
|
|
||||||
public function url()
|
public function url()
|
||||||
{
|
{
|
||||||
return Storage::url($this->media_path);
|
return url(Storage::url($this->media_path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue