2017-03-09 22:00:29 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
class Media extends Model
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The table associated with the model.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $table = 'media_endpoint';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the note that owns this media.
|
|
|
|
*/
|
|
|
|
public function note()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('App\Note');
|
|
|
|
}
|
2017-03-10 09:58:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the URL for an S3 media file.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getUrlAttribute()
|
|
|
|
{
|
2017-03-10 11:27:28 +00:00
|
|
|
return config('filesystems.disks.s3.url') . '/' . $this->path;
|
2017-03-10 09:58:35 +00:00
|
|
|
}
|
2017-03-09 22:00:29 +00:00
|
|
|
}
|