public function editPreparation($product) { $item = Item::find($product->organizations->first()->pivot->id); $itemtags = $item->tags->lists(['id'])->toArray(); $book = $product->is; $bookauthors = $book->authors->lists(['id'])->toArray(); $categories = $this->getCategoriesByRecursion($item->cat_id); $authors = Author::get()->lists('full_name', 'id'); $editors = ['' => ''] + Editor::lists('e_name', 'id')->all(); $tags = Tag::lists('tag_name', 'id'); return compact('product', 'itemtags', 'authors', 'editors', 'categories', 'tags', 'book', 'item', 'bookauthors', 'categories'); }