add private option to attachments
This commit is contained in:
@@ -4,6 +4,8 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
|
||||
class Attachment extends Model
|
||||
{
|
||||
@@ -16,11 +18,23 @@ class Attachment extends Model
|
||||
*/
|
||||
protected $fillable = [
|
||||
'media_id',
|
||||
'private',
|
||||
];
|
||||
|
||||
/**
|
||||
* The default attributes.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $attributes = [
|
||||
'private' => 'false',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Get attachments attachable
|
||||
*
|
||||
* @return MorphTo
|
||||
*/
|
||||
public function attachable()
|
||||
{
|
||||
@@ -29,9 +43,11 @@ class Attachment extends Model
|
||||
|
||||
/**
|
||||
* Get the media for this attachment.
|
||||
*
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function media()
|
||||
{
|
||||
return $this->belongsTo(Media::class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user