add attachments structure
This commit is contained in:
@@ -27,7 +27,7 @@ class Post extends Model
|
||||
|
||||
|
||||
/**
|
||||
* Get the file user
|
||||
* Get the post user
|
||||
*
|
||||
* @return BelongsTo
|
||||
*/
|
||||
@@ -35,4 +35,12 @@ class Post extends Model
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all of the post's attachments.
|
||||
*/
|
||||
public function attachments()
|
||||
{
|
||||
return $this->morphMany('App\Attachment', 'attachable');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user