add attachments structure

This commit is contained in:
2023-02-24 12:53:26 +10:00
parent 4ee8fd2400
commit 6ebb915c68
6 changed files with 170 additions and 1 deletions

View File

@@ -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');
}
}