diff --git a/app/Http/Controllers/Admin/Data/ItemController.php b/app/Http/Controllers/Admin/Data/ItemController.php index d7c0996596..958b7d2cb0 100644 --- a/app/Http/Controllers/Admin/Data/ItemController.php +++ b/app/Http/Controllers/Admin/Data/ItemController.php @@ -208,7 +208,7 @@ public function getItemIndex(Request $request) { return view('admin.items.items', [ 'items' => $query->paginate(20)->appends($request->query()), 'categories' => ['none' => 'Any Category'] + ItemCategory::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(), - 'artists' => ['none' => 'Any Artist'] + User::whereIn('id', Item::whereNotNull('artist_id')->pluck('artist_id')->toArray())->pluck('name', 'id')->toArray(), + 'artists' => User::whereIn('id', Item::whereNotNull('artist_id')->pluck('artist_id')->toArray())->pluck('name', 'id')->toArray(), ]); } diff --git a/app/Http/Controllers/Characters/CharacterController.php b/app/Http/Controllers/Characters/CharacterController.php index 0badfceb89..eb2caa4581 100644 --- a/app/Http/Controllers/Characters/CharacterController.php +++ b/app/Http/Controllers/Characters/CharacterController.php @@ -267,6 +267,7 @@ public function getCharacterInventory(Request $request, $slug) { 'categories' => $categories->keyBy('id'), 'items' => $items, 'logs' => $this->character->getItemLogs(), + 'artists' => User::whereIn('id', Item::whereNotNull('artist_id')->pluck('artist_id')->toArray())->pluck('name', 'id')->toArray(), ] + (Auth::check() && (Auth::user()->hasPower('edit_inventories') || Auth::user()->id == $this->character->user_id) ? [ 'itemOptions' => $itemOptions->pluck('name', 'id'), 'userInventory' => UserItem::with('item')->whereIn('item_id', $itemOptions->pluck('id'))->whereNull('deleted_at')->where('count', '>', '0')->where('user_id', Auth::user()->id)->get()->filter(function ($userItem) { diff --git a/app/Http/Controllers/Users/InventoryController.php b/app/Http/Controllers/Users/InventoryController.php index 7c6485f128..7a66e0fc57 100644 --- a/app/Http/Controllers/Users/InventoryController.php +++ b/app/Http/Controllers/Users/InventoryController.php @@ -68,6 +68,7 @@ public function getIndex(Request $request) { 'items' => $items, 'userOptions' => User::visible()->where('id', '!=', Auth::user()->id)->orderBy('name')->pluck('name', 'id')->toArray(), 'user' => Auth::user(), + 'artists' => ['none' => 'Any Artist'] + User::whereIn('id', Item::whereNotNull('artist_id')->pluck('artist_id')->toArray())->pluck('name', 'id')->toArray(), ]); } diff --git a/app/Http/Controllers/Users/UserController.php b/app/Http/Controllers/Users/UserController.php index a6f03b61d6..642788ebac 100644 --- a/app/Http/Controllers/Users/UserController.php +++ b/app/Http/Controllers/Users/UserController.php @@ -236,6 +236,7 @@ public function getUserInventory(Request $request, $name) { 'userOptions' => User::where('id', '!=', $this->user->id)->orderBy('name')->pluck('name', 'id')->toArray(), 'user' => $this->user, 'logs' => $this->user->getItemLogs(), + 'artists' => User::whereIn('id', Item::whereNotNull('artist_id')->pluck('artist_id')->toArray())->pluck('name', 'id')->toArray(), ]); } diff --git a/app/Http/Controllers/WorldController.php b/app/Http/Controllers/WorldController.php index 18b3e408a9..29b30afbe2 100644 --- a/app/Http/Controllers/WorldController.php +++ b/app/Http/Controllers/WorldController.php @@ -409,7 +409,7 @@ public function getItems(Request $request) { 'items' => $query->orderBy('id')->paginate(20)->appends($request->query()), 'categories' => ['none' => 'Any Category'] + ['withoutOption' => 'Without Category'] + ItemCategory::visible(Auth::user() ?? null)->orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(), 'shops' => Shop::orderBy('sort', 'DESC')->get(), - 'artists' => ['none' => 'Any Artist'] + User::whereIn('id', Item::whereNotNull('artist_id')->pluck('artist_id')->toArray())->pluck('name', 'id')->toArray(), + 'artists' => User::whereIn('id', Item::whereNotNull('artist_id')->pluck('artist_id')->toArray())->pluck('name', 'id')->toArray(), ]); } diff --git a/config/lorekeeper/extensions.php b/config/lorekeeper/extensions.php index 77c98d019e..4034f73071 100644 --- a/config/lorekeeper/extensions.php +++ b/config/lorekeeper/extensions.php @@ -47,7 +47,7 @@ // Item Entry Expansion - Mercury 'item_entry_expansion' => [ - 'extra_fields' => 0, + 'extra_fields' => 1, 'resale_function' => 0, 'loot_tables' => [ // Adds the ability to use either rarity criteria for items or item categories with rarity criteria in loot tables. Note that disabling this does not apply retroactively. diff --git a/resources/views/admin/items/items.blade.php b/resources/views/admin/items/items.blade.php index a1053b0ffa..1f7364a31f 100644 --- a/resources/views/admin/items/items.blade.php +++ b/resources/views/admin/items/items.blade.php @@ -31,7 +31,7 @@ @if (config('lorekeeper.extensions.item_entry_expansion.extra_fields'))