From 1a33114cea7156bd613969de6023e8c006ec4808 Mon Sep 17 00:00:00 2001 From: Timur <42815774+TimurTurdyev@users.noreply.github.com> Date: Tue, 18 Jan 2022 18:14:20 +0300 Subject: [PATCH] Update attachments.md Undefined property: Illuminate\Database\Eloquent\Relations\MorphToMany::$each --- docs/en/docs/attachments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/attachments.md b/docs/en/docs/attachments.md index 703574647..72a4a6485 100644 --- a/docs/en/docs/attachments.md +++ b/docs/en/docs/attachments.md @@ -121,7 +121,7 @@ When you have multiple attachments, you should use `attachment` relation from th public function deleting(Post $post) { //load attachment as collection and not query attachment() - $post->attachment->each->delete(); + $post->attachment()->delete(); } ```