-
app/Http/Controllers/Common/Items.php
Open in GitHubuse App\Models\Setting\Category; use App\Models\Setting\Tax; class Items extends Controller { public function edit(Item $item) { $categories = Category::item()->enabled()->orderBy('name')->take(setting('default.select_limit'))->pluck('name', 'id'); if ($item->category && !$categories->has($item->category_id)) { $categories->put($item->category->id, $item->category->name); } $taxes = Tax::enabled()->orderBy('name')->get()->pluck('title', 'id'); return view('common.items.edit', compact('item', 'categories', 'taxes')); } }