diff --git a/app/Helpers/AssetHelpers.php b/app/Helpers/AssetHelpers.php index c1fde8dc1a..c870b91f35 100644 --- a/app/Helpers/AssetHelpers.php +++ b/app/Helpers/AssetHelpers.php @@ -277,11 +277,11 @@ function parseAssetData($array) { * Distributes the assets in an assets array to the given recipient (user). * Loot tables will be rolled before distribution. * - * @param array $assets - * @param \App\Models\User\User $sender - * @param \App\Models\User\User $recipient - * @param string $logType - * @param string $data + * @param array $assets + * @param App\Models\User\User $sender + * @param App\Models\User\User $recipient + * @param string $logType + * @param string $data * * @return array */ @@ -296,35 +296,35 @@ function fillUserAssets($assets, $sender, $recipient, $logType, $data) { foreach ($assets as $key => $contents) { if ($key == 'items' && count($contents)) { - $service = new \App\Services\InventoryManager; + $service = new App\Services\InventoryManager; foreach ($contents as $asset) { if (!$service->creditItem($sender, $recipient, $logType, $data, $asset['asset'], $asset['quantity'])) { return false; } } } elseif ($key == 'currencies' && count($contents)) { - $service = new \App\Services\CurrencyManager; + $service = new App\Services\CurrencyManager; foreach ($contents as $asset) { if (!$service->creditCurrency($sender, $recipient, $logType, $data['data'], $asset['asset'], $asset['quantity'])) { return false; } } } elseif ($key == 'raffle_tickets' && count($contents)) { - $service = new \App\Services\RaffleManager; + $service = new App\Services\RaffleManager; foreach ($contents as $asset) { if (!$service->addTicket($recipient, $asset['asset'], $asset['quantity'])) { return false; } } } elseif ($key == 'user_items' && count($contents)) { - $service = new \App\Services\InventoryManager; + $service = new App\Services\InventoryManager; foreach ($contents as $asset) { if (!$service->moveStack($sender, $recipient, $logType, $data, $asset['asset'])) { return false; } } } elseif ($key == 'characters' && count($contents)) { - $service = new \App\Services\CharacterManager; + $service = new App\Services\CharacterManager; foreach ($contents as $asset) { if (!$service->moveCharacter($asset['asset'], $recipient, $data, $asset['quantity'], $logType)) { return false; @@ -340,12 +340,12 @@ function fillUserAssets($assets, $sender, $recipient, $logType, $data) { * Distributes the assets in an assets array to the given recipient (character). * Loot tables will be rolled before distribution. * - * @param array $assets - * @param \App\Models\User\User $sender - * @param \App\Models\Character\Character $recipient - * @param string $logType - * @param string $data - * @param mixed|null $submitter + * @param array $assets + * @param App\Models\User\User $sender + * @param App\Models\Character\Character $recipient + * @param string $logType + * @param string $data + * @param mixed|null $submitter * * @return array */ @@ -366,14 +366,14 @@ function fillCharacterAssets($assets, $sender, $recipient, $logType, $data, $sub foreach ($assets as $key => $contents) { if ($key == 'currencies' && count($contents)) { - $service = new \App\Services\CurrencyManager; + $service = new App\Services\CurrencyManager; foreach ($contents as $asset) { if (!$service->creditCurrency($sender, ($asset['asset']->is_character_owned ? $recipient : $item_recipient), $logType, $data['data'], $asset['asset'], $asset['quantity'])) { return false; } } } elseif ($key == 'items' && count($contents)) { - $service = new \App\Services\InventoryManager; + $service = new App\Services\InventoryManager; foreach ($contents as $asset) { if (!$service->creditItem($sender, (($asset['asset']->category && $asset['asset']->category->is_character_owned) ? $recipient : $item_recipient), $logType, $data, $asset['asset'], $asset['quantity'])) { return false; diff --git a/app/Helpers/Helpers.php b/app/Helpers/Helpers.php index 6d6d170a5c..4d6ecc1959 100644 --- a/app/Helpers/Helpers.php +++ b/app/Helpers/Helpers.php @@ -72,8 +72,8 @@ function breadcrumbs($links) { /** * Formats the timestamp to a standard format. * - * @param \Illuminate\Support\Carbon\Carbon $timestamp - * @param mixed $showTime + * @param Illuminate\Support\Carbon\Carbon $timestamp + * @param mixed $showTime * * @return string */ @@ -160,7 +160,7 @@ function parseUsers($text, &$users) { if ($count) { $matches = array_unique($matches[1]); foreach ($matches as $match) { - $user = \App\Models\User\User::where('name', $match)->first(); + $user = App\Models\User\User::where('name', $match)->first(); if ($user) { $users[] = $user; $text = preg_replace('/\B@'.$match.'/', $user->displayName, $text); @@ -187,7 +187,7 @@ function parseUsersAndAvatars($text, &$users) { if ($count) { $matches = array_unique($matches[1]); foreach ($matches as $match) { - $user = \App\Models\User\User::where('name', $match)->first(); + $user = App\Models\User\User::where('name', $match)->first(); if ($user) { $users[] = $user; $text = preg_replace('/\B%'.$match.'/', ''.$user->name.'\'s Avatar'.$user->displayName, $text); @@ -214,7 +214,7 @@ function parseUserIDs($text, &$users) { if ($count) { $matches = array_unique($matches[1]); foreach ($matches as $match) { - $user = \App\Models\User\User::where('id', $match)->first(); + $user = App\Models\User\User::where('id', $match)->first(); if ($user) { $users[] = $user; $text = preg_replace('/\[user='.$match.'\]/', $user->displayName, $text); @@ -241,7 +241,7 @@ function parseUserIDsForAvatars($text, &$users) { if ($count) { $matches = array_unique($matches[1]); foreach ($matches as $match) { - $user = \App\Models\User\User::where('id', $match)->first(); + $user = App\Models\User\User::where('id', $match)->first(); if ($user) { $users[] = $user; $text = preg_replace('/\[userav='.$match.'\]/', ''.$user->name.'\'s Avatar', $text); @@ -268,7 +268,7 @@ function parseCharacters($text, &$characters) { if ($count) { $matches = array_unique($matches[1]); foreach ($matches as $match) { - $character = \App\Models\Character\Character::where('slug', $match)->first(); + $character = App\Models\Character\Character::where('slug', $match)->first(); if ($character) { $characters[] = $character; $text = preg_replace('/\[character='.$match.'\]/', $character->displayName, $text); @@ -295,7 +295,7 @@ function parseCharacterThumbs($text, &$characters) { if ($count) { $matches = array_unique($matches[1]); foreach ($matches as $match) { - $character = \App\Models\Character\Character::where('slug', $match)->first(); + $character = App\Models\Character\Character::where('slug', $match)->first(); if ($character) { $characters[] = $character; $text = preg_replace('/\[charthumb='.$match.'\]/', 'Thumbnail of '.$character->fullName.'', $text); @@ -322,7 +322,7 @@ function parseGalleryThumbs($text, &$submissions) { if ($count) { $matches = array_unique($matches[1]); foreach ($matches as $match) { - $submission = \App\Models\Gallery\GallerySubmission::where('id', $match)->first(); + $submission = App\Models\Gallery\GallerySubmission::where('id', $match)->first(); if ($submission) { $submissions[] = $submission; $text = preg_replace('/\[thumb='.$match.'\]/', ''.view('widgets._gallery_thumb', ['submission' => $submission]).'', $text); @@ -374,7 +374,7 @@ function checkAlias($url, $failOnError = true) { } } if ((!isset($matches[0]) || $matches[0] == []) && $failOnError) { - throw new \Exception('This URL is from an invalid site. Please provide a URL for a user profile from a site used for authentication.'); + throw new Exception('This URL is from an invalid site. Please provide a URL for a user profile from a site used for authentication.'); } // and 2. if it contains an alias associated with a user on-site. diff --git a/app/Http/Controllers/Admin/Data/CurrencyController.php b/app/Http/Controllers/Admin/Data/CurrencyController.php index 518366f50c..7d2058fe6a 100644 --- a/app/Http/Controllers/Admin/Data/CurrencyController.php +++ b/app/Http/Controllers/Admin/Data/CurrencyController.php @@ -54,7 +54,8 @@ public function getEditCurrency($id) { } return view('admin.currencies.create_edit_currency', [ - 'currency' => $currency, + 'currency' => $currency, + 'currencies' => Currency::where('id', '!=', $id)->get()->sortBy('name')->pluck('name', 'id'), ]); } @@ -73,6 +74,7 @@ public function postCreateEditCurrency(Request $request, CurrencyService $servic 'name', 'abbreviation', 'description', 'is_displayed', 'allow_user_to_user', 'allow_user_to_character', 'allow_character_to_user', 'icon', 'image', 'remove_icon', 'remove_image', + 'conversion_id', 'rate', ]); if ($id && $service->updateCurrency(Currency::find($id), $data, Auth::user())) { flash('Currency updated successfully.')->success(); diff --git a/app/Http/Controllers/Admin/Data/FeatureController.php b/app/Http/Controllers/Admin/Data/FeatureController.php index 8c720ff6e6..049e0bcdb7 100644 --- a/app/Http/Controllers/Admin/Data/FeatureController.php +++ b/app/Http/Controllers/Admin/Data/FeatureController.php @@ -164,29 +164,75 @@ public function postSortFeatureCategory(Request $request, FeatureService $servic */ public function getFeatureIndex(Request $request) { $query = Feature::query(); - $data = $request->only(['rarity_id', 'feature_category_id', 'species_id', 'subtype_id', 'name']); + $data = $request->only(['rarity_id', 'feature_category_id', 'species_id', 'subtype_id', 'name', 'sort']); if (isset($data['rarity_id']) && $data['rarity_id'] != 'none') { $query->where('rarity_id', $data['rarity_id']); } if (isset($data['feature_category_id']) && $data['feature_category_id'] != 'none') { - $query->where('feature_category_id', $data['feature_category_id']); + if ($data['feature_category_id'] == 'withoutOption') { + $query->whereNull('feature_category_id'); + } else { + $query->where('feature_category_id', $data['feature_category_id']); + } } if (isset($data['species_id']) && $data['species_id'] != 'none') { - $query->where('species_id', $data['species_id']); + if ($data['species_id'] == 'withoutOption') { + $query->whereNull('species_id'); + } else { + $query->where('species_id', $data['species_id']); + } } if (isset($data['subtype_id']) && $data['subtype_id'] != 'none') { - $query->where('subtype_id', $data['subtype_id']); + if ($data['subtype_id'] == 'withoutOption') { + $query->whereNull('subtype_id'); + } else { + $query->where('subtype_id', $data['subtype_id']); + } } if (isset($data['name'])) { $query->where('name', 'LIKE', '%'.$data['name'].'%'); } + if (isset($data['sort'])) { + switch ($data['sort']) { + case 'alpha': + $query->sortAlphabetical(); + break; + case 'alpha-reverse': + $query->sortAlphabetical(true); + break; + case 'category': + $query->sortCategory(); + break; + case 'rarity': + $query->sortRarity(); + break; + case 'rarity-reverse': + $query->sortRarity(true); + break; + case 'species': + $query->sortSpecies(); + break; + case 'subtypes': + $query->sortSubtype(); + break; + case 'newest': + $query->sortNewest(); + break; + case 'oldest': + $query->sortOldest(); + break; + } + } else { + $query->sortOldest(); + } + return view('admin.features.features', [ 'features' => $query->paginate(20)->appends($request->query()), 'rarities' => ['none' => 'Any Rarity'] + Rarity::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(), - 'specieses' => ['none' => 'Any Species'] + Species::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(), - 'subtypes' => ['none' => 'Any Subtype'] + Subtype::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(), - 'categories' => ['none' => 'Any Category'] + FeatureCategory::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(), + 'specieses' => ['none' => 'Any Species'] + ['withoutOption' => 'Without Species'] + Species::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(), + 'subtypes' => ['none' => 'Any Subtype'] + ['withoutOption' => 'Without Subtype'] + Subtype::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(), + 'categories' => ['none' => 'Any Category'] + ['withoutOption' => 'Without Category'] + FeatureCategory::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(), ]); } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 13946d23a0..106ab6de47 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -96,7 +96,7 @@ public function postRegisterWithDriver(LinkService $service, Request $request, $ /** * Create a new user instance after a valid registration. * - * @return \App\Models\User\User + * @return User */ protected function create(array $data) { DB::beginTransaction(); diff --git a/app/Http/Controllers/Users/BankController.php b/app/Http/Controllers/Users/BankController.php index 7efe080ec3..cb36223319 100644 --- a/app/Http/Controllers/Users/BankController.php +++ b/app/Http/Controllers/Users/BankController.php @@ -29,7 +29,8 @@ public function getIndex() { return view('home.bank', [ 'currencyOptions' => Currency::where('allow_user_to_user', 1)->where('is_user_owned', 1)->whereIn('id', UserCurrency::where('user_id', Auth::user()->id)->pluck('currency_id')->toArray())->orderBy('sort_user', 'DESC')->pluck('name', 'id')->toArray(), 'userOptions' => User::visible()->where('id', '!=', Auth::user()->id)->orderBy('name')->pluck('name', 'id')->toArray(), - + // only get currency with currency_conversions relationship + 'convertOptions' => Currency::where('is_user_owned', 1)->whereHas('conversions')->orderBy('sort_user', 'DESC')->pluck('name', 'id')->toArray(), ]); } @@ -51,4 +52,54 @@ public function postTransfer(Request $request, CurrencyManager $service) { return redirect()->back(); } + + /** + * Gets the currency conversion form for the user. + * + * @param mixed $id + * + * @return \Illuminate\Http\RedirectResponse + */ + public function getConvertCurrency($id) { + $currency = Currency::where('is_user_owned', 1)->where('id', $id)->first(); + $convertOptions = Currency::whereIn('id', $currency->conversions->pluck('conversion_id')->toArray())->orderBy('sort_user', 'DESC')->pluck('name', 'id')->toArray(); + + return view('home._bank_convert', [ + 'convertOptions' => $convertOptions, + ]); + } + + /** + * Gets the currency conversion rate for the user. + * + * @param mixed $currency_id + * @param mixed $conversion_id + * + * @return \Illuminate\Http\RedirectResponse + */ + public function getConvertCurrencyRate($currency_id, $conversion_id) { + $currency = Currency::where('is_user_owned', 1)->where('id', $currency_id)->first(); + + return $currency->conversions()->where('conversion_id', $conversion_id)->first()->ratio(); + } + + /** + * Converts currency from one type to another. + * + * @param App\Services\CurrencyManager $service + * + * @return \Illuminate\Http\RedirectResponse + */ + public function postConvertCurrency(Request $request, CurrencyManager $service) { + $data = $request->only(['currency_id', 'conversion_id', 'quantity']); + if ($service->convertCurrency(Currency::find($data['currency_id']), Currency::find($data['conversion_id']), $data['quantity'], Auth::user())) { + flash('Currency converted successfully.')->success(); + } else { + foreach ($service->errors()->getMessages()['error'] as $error) { + flash($error)->error(); + } + } + + return redirect()->back(); + } } diff --git a/app/Http/Controllers/Users/SubmissionController.php b/app/Http/Controllers/Users/SubmissionController.php index 4e19889b83..e87cb8e387 100644 --- a/app/Http/Controllers/Users/SubmissionController.php +++ b/app/Http/Controllers/Users/SubmissionController.php @@ -6,6 +6,8 @@ use App\Http\Controllers\Controller; use App\Models\Character\Character; use App\Models\Currency\Currency; +use App\Models\Gallery\GallerySubmission; +use App\Models\Gallery\GallerySubmissionCollaborator; use App\Models\Item\Item; use App\Models\Item\ItemCategory; use App\Models\Prompt\Prompt; @@ -86,21 +88,34 @@ public function getNewSubmission(Request $request) { $closed = !Settings::get('is_prompts_open'); $inventory = UserItem::with('item')->whereNull('deleted_at')->where('count', '>', '0')->where('user_id', Auth::user()->id)->get(); + if (config('lorekeeper.settings.allow_gallery_submissions_on_prompts')) { + $collaboratorIds = GallerySubmissionCollaborator::where('user_id', Auth::user()->id)->where('has_approved', 1)->pluck('gallery_submission_id')->toArray(); + + $gallerySubmissions = GallerySubmission::where('is_visible', true)->where('user_id', Auth::user()->id)->orWhereIn('id', $collaboratorIds)->orderBy('id', 'DESC')->get()->pluck('title', 'id'); + + $gallerySubmissions = $gallerySubmissions->map(function ($item, $key) { + return '"'.$item.'" by '.Auth::user()->name; + }); + } else { + $gallerySubmissions = []; + } + return view('home.create_submission', [ 'closed' => $closed, 'isClaim' => false, ] + ($closed ? [] : [ - 'submission' => new Submission, - 'prompts' => Prompt::active()->sortAlphabetical()->pluck('name', 'id')->toArray(), - 'characterCurrencies' => Currency::where('is_character_owned', 1)->orderBy('sort_character', 'DESC')->pluck('name', 'id'), - 'categories' => ItemCategory::visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC')->get(), - 'item_filter' => Item::orderBy('name')->released()->get()->keyBy('id'), - 'items' => Item::orderBy('name')->released()->pluck('name', 'id'), - 'character_items' => Item::whereIn('item_category_id', ItemCategory::where('is_character_owned', 1)->pluck('id')->toArray())->orderBy('name')->released()->pluck('name', 'id'), - 'currencies' => Currency::where('is_user_owned', 1)->orderBy('name')->pluck('name', 'id'), - 'inventory' => $inventory, - 'page' => 'submission', - 'expanded_rewards' => config('lorekeeper.extensions.character_reward_expansion.expanded'), + 'submission' => new Submission, + 'prompts' => Prompt::active()->sortAlphabetical()->pluck('name', 'id')->toArray(), + 'characterCurrencies' => Currency::where('is_character_owned', 1)->orderBy('sort_character', 'DESC')->pluck('name', 'id'), + 'categories' => ItemCategory::visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC')->get(), + 'item_filter' => Item::orderBy('name')->released()->get()->keyBy('id'), + 'items' => Item::orderBy('name')->released()->pluck('name', 'id'), + 'character_items' => Item::whereIn('item_category_id', ItemCategory::where('is_character_owned', 1)->pluck('id')->toArray())->orderBy('name')->released()->pluck('name', 'id'), + 'currencies' => Currency::where('is_user_owned', 1)->orderBy('name')->pluck('name', 'id'), + 'inventory' => $inventory, + 'page' => 'submission', + 'expanded_rewards' => config('lorekeeper.extensions.character_reward_expansion.expanded'), + 'userGallerySubmissions' => $gallerySubmissions, ])); } @@ -119,23 +134,33 @@ public function getEditSubmission(Request $request, $id) { abort(404); } + if (config('lorekeeper.settings.allow_gallery_submissions_on_prompts')) { + $gallerySubmissions = GallerySubmission::where('user_id', Auth::user()->id)->where('status', 'Accepted')->orderBy('id', 'DESC')->get()->pluck('title', 'id'); + $gallerySubmissions = $gallerySubmissions->map(function ($item, $key) { + return '"'.$item.'" by '.Auth::user()->name; + }); + } else { + $gallerySubmissions = []; + } + return view('home.edit_submission', [ 'closed' => $closed, 'isClaim' => false, ] + ($closed ? [] : [ - 'submission' => $submission, - 'prompts' => Prompt::active()->sortAlphabetical()->pluck('name', 'id')->toArray(), - 'characterCurrencies' => Currency::where('is_character_owned', 1)->orderBy('sort_character', 'DESC')->pluck('name', 'id'), - 'categories' => ItemCategory::orderBy('sort', 'DESC')->get(), - 'item_filter' => Item::orderBy('name')->released()->get()->keyBy('id'), - 'items' => Item::orderBy('name')->released()->pluck('name', 'id'), - 'character_items' => Item::whereIn('item_category_id', ItemCategory::where('is_character_owned', 1)->pluck('id')->toArray())->orderBy('name')->released()->pluck('name', 'id'), - 'currencies' => Currency::where('is_user_owned', 1)->orderBy('name')->pluck('name', 'id'), - 'inventory' => $inventory, - 'page' => 'submission', - 'expanded_rewards' => config('lorekeeper.extensions.character_reward_expansion.expanded'), - 'selectedInventory' => isset($submission->data['user']) ? parseAssetData($submission->data['user']) : null, - 'count' => Submission::where('prompt_id', $submission->prompt_id)->where('status', 'Approved')->where('user_id', $submission->user_id)->count(), + 'submission' => $submission, + 'prompts' => Prompt::active()->sortAlphabetical()->pluck('name', 'id')->toArray(), + 'characterCurrencies' => Currency::where('is_character_owned', 1)->orderBy('sort_character', 'DESC')->pluck('name', 'id'), + 'categories' => ItemCategory::orderBy('sort', 'DESC')->get(), + 'item_filter' => Item::orderBy('name')->released()->get()->keyBy('id'), + 'items' => Item::orderBy('name')->released()->pluck('name', 'id'), + 'character_items' => Item::whereIn('item_category_id', ItemCategory::where('is_character_owned', 1)->pluck('id')->toArray())->orderBy('name')->released()->pluck('name', 'id'), + 'currencies' => Currency::where('is_user_owned', 1)->orderBy('name')->pluck('name', 'id'), + 'inventory' => $inventory, + 'page' => 'submission', + 'expanded_rewards' => config('lorekeeper.extensions.character_reward_expansion.expanded'), + 'selectedInventory' => isset($submission->data['user']) ? parseAssetData($submission->data['user']) : null, + 'count' => Submission::where('prompt_id', $submission->prompt_id)->where('status', 'Approved')->where('user_id', $submission->user_id)->count(), + 'userGallerySubmissions' => $gallerySubmissions, ])); } @@ -183,7 +208,16 @@ public function getPromptInfo($id) { */ public function postNewSubmission(Request $request, SubmissionManager $service, $draft = false) { $request->validate(Submission::$createRules); - if ($submission = $service->createSubmission($request->only(['url', 'prompt_id', 'comments', 'slug', 'character_rewardable_type', 'character_rewardable_id', 'character_rewardable_quantity', 'rewardable_type', 'rewardable_id', 'quantity', 'stack_id', 'stack_quantity', 'currency_id', 'currency_quantity']), Auth::user(), false, $draft)) { + if ($submission = $service->createSubmission( + $request->only([ + 'url', 'prompt_id', 'comments', 'slug', 'character_rewardable_type', 'character_rewardable_id', 'character_rewardable_quantity', + 'rewardable_type', 'rewardable_id', 'quantity', 'stack_id', 'stack_quantity', 'currency_id', 'currency_quantity', + 'gallery_submission_id', + ]), + Auth::user(), + false, + $draft + )) { if ($submission->status == 'Draft') { flash('Draft created successfully.')->success(); @@ -220,9 +254,17 @@ public function postEditSubmission(Request $request, SubmissionManager $service, } $request->validate(Submission::$updateRules); - if ($submit && $service->editSubmission($submission, $request->only(['url', 'prompt_id', 'comments', 'slug', 'character_rewardable_type', 'character_rewardable_id', 'character_rewardable_quantity', 'rewardable_type', 'rewardable_id', 'quantity', 'stack_id', 'stack_quantity', 'currency_id', 'currency_quantity']), Auth::user(), false, $submit)) { + if ($submit && $service->editSubmission($submission, $request->only([ + 'url', 'prompt_id', 'comments', 'slug', 'character_rewardable_type', 'character_rewardable_id', 'character_rewardable_quantity', + 'rewardable_type', 'rewardable_id', 'quantity', 'stack_id', 'stack_quantity', 'currency_id', 'currency_quantity', + 'gallery_submission_id', + ]), Auth::user(), false, $submit)) { flash('Draft submitted successfully.')->success(); - } elseif ($service->editSubmission($submission, $request->only(['url', 'prompt_id', 'comments', 'slug', 'character_rewardable_type', 'character_rewardable_id', 'character_rewardable_quantity', 'rewardable_type', 'rewardable_id', 'quantity', 'stack_id', 'stack_quantity', 'currency_id', 'currency_quantity']), Auth::user())) { + } elseif ($service->editSubmission($submission, $request->only([ + 'url', 'prompt_id', 'comments', 'slug', 'character_rewardable_type', 'character_rewardable_id', 'character_rewardable_quantity', + 'rewardable_type', 'rewardable_id', 'quantity', 'stack_id', 'stack_quantity', 'currency_id', 'currency_quantity', + 'gallery_submission_id', + ]), Auth::user())) { flash('Draft saved successfully.')->success(); return redirect()->back(); diff --git a/app/Http/Controllers/WorldController.php b/app/Http/Controllers/WorldController.php index e733874f07..20cc4295e4 100644 --- a/app/Http/Controllers/WorldController.php +++ b/app/Http/Controllers/WorldController.php @@ -300,6 +300,65 @@ public function getSpeciesFeatureDetail($speciesId, $id) { ]); } + /** + * Shows a universal visual trait list. + * + * @return \Illuminate\Contracts\Support\Renderable + */ + public function getUniversalFeatures(Request $request) { + $categories = FeatureCategory::orderBy('sort', 'DESC')->get(); + $rarities = Rarity::orderBy('sort', 'ASC')->get(); + + if (!config('lorekeeper.extensions.universal_trait_index.enable')) { + abort(404); + } + + $features = count($categories) ? + $query = Feature::whereNull('species_id') + ->visible() + ->orderByRaw('FIELD(feature_category_id,'.implode(',', $categories->pluck('id')->toArray()).')') + ->orderByRaw('FIELD(rarity_id,'.implode(',', $rarities->pluck('id')->toArray()).')') + ->orderBy('has_image', 'DESC') + ->orderBy('name') + ->get() + ->groupBy(['feature_category_id', 'id']) : + $query = Feature::whereNull('species_id') + ->visible() + ->orderByRaw('FIELD(rarity_id,'.implode(',', $rarities->pluck('id')->toArray()).')') + ->orderBy('has_image', 'DESC') + ->orderBy('name') + ->get() + ->groupBy(['feature_category_id', 'id']); + + return view('world.universal_features', [ + 'categories' => $categories->keyBy('id'), + 'rarities' => $rarities->keyBy('id'), + 'features' => $features, + ]); + } + + /** + * Provides a single trait's description html for use in a modal. (Universal Trait Index). + * + * @param mixed $id + * + * @return \Illuminate\Contracts\Support\Renderable + */ + public function getUniversalFeatureDetail($id) { + $feature = Feature::where('id', $id)->first(); + + if (!$feature) { + abort(404); + } + if (!config('lorekeeper.extensions.universal_trait_index.trait_modals')) { + abort(404); + } + + return view('world._feature_entry', [ + 'feature' => $feature, + ]); + } + /** * Shows the items page. * diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 2f3909e56d..0e2a41285a 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -13,11 +13,11 @@ class Kernel extends HttpKernel { * @var array */ protected $middleware = [ - \App\Http\Middleware\CheckForMaintenanceMode::class, + Middleware\CheckForMaintenanceMode::class, \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, - \App\Http\Middleware\TrimStrings::class, + Middleware\TrimStrings::class, \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, - \App\Http\Middleware\TrustProxies::class, + Middleware\TrustProxies::class, ]; /** @@ -27,12 +27,12 @@ class Kernel extends HttpKernel { */ protected $middlewareGroups = [ 'web' => [ - \App\Http\Middleware\EncryptCookies::class, + Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\Session\Middleware\StartSession::class, // \Illuminate\Session\Middleware\AuthenticateSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, - \App\Http\Middleware\VerifyCsrfToken::class, + Middleware\VerifyCsrfToken::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, ], @@ -50,16 +50,16 @@ class Kernel extends HttpKernel { * @var array */ protected $routeMiddleware = [ - 'auth' => \App\Http\Middleware\Authenticate::class, + 'auth' => Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, - 'alias' => \App\Http\Middleware\CheckAlias::class, - 'power' => \App\Http\Middleware\CheckPower::class, - 'admin' => \App\Http\Middleware\CheckAdmin::class, - 'staff' => \App\Http\Middleware\CheckStaff::class, - 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'alias' => Middleware\CheckAlias::class, + 'power' => Middleware\CheckPower::class, + 'admin' => Middleware\CheckAdmin::class, + 'staff' => Middleware\CheckStaff::class, + 'guest' => Middleware\RedirectIfAuthenticated::class, 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, @@ -75,7 +75,7 @@ class Kernel extends HttpKernel { protected $middlewarePriority = [ \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, - \App\Http\Middleware\Authenticate::class, + Middleware\Authenticate::class, \Illuminate\Session\Middleware\AuthenticateSession::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, \Illuminate\Auth\Middleware\Authorize::class, diff --git a/app/Models/Character/CharacterImage.php b/app/Models/Character/CharacterImage.php index 8f24464d65..80281c731a 100644 --- a/app/Models/Character/CharacterImage.php +++ b/app/Models/Character/CharacterImage.php @@ -227,7 +227,7 @@ public function getFullsizeUrlAttribute() { /** * Gets the file name of the model's fullsize image. * - * @param user + * @param User * @param mixed|null $user * * @return string diff --git a/app/Models/Currency/Currency.php b/app/Models/Currency/Currency.php index 86776a09b0..1a4846ccf9 100644 --- a/app/Models/Currency/Currency.php +++ b/app/Models/Currency/Currency.php @@ -49,6 +49,19 @@ class Currency extends Model { 'image' => 'mimes:png', ]; + /********************************************************************************************** + + RELATIONSHIPS + + **********************************************************************************************/ + + /** + * Get the conversion options for the currency. + */ + public function conversions() { + return $this->hasMany(CurrencyConversion::class, 'currency_id'); + } + /********************************************************************************************** ACCESSORS diff --git a/app/Models/Currency/CurrencyConversion.php b/app/Models/Currency/CurrencyConversion.php new file mode 100644 index 0000000000..7c3cc859bb --- /dev/null +++ b/app/Models/Currency/CurrencyConversion.php @@ -0,0 +1,101 @@ + 'required|exists:currencies,id', + 'conversion_id' => 'required|exists:currencies,id', + 'rate' => 'required|numeric', + ]; + + /** + * Validation rules for updating. + * + * @var array + */ + public static $updateRules = [ + 'currency_id' => 'required|exists:currencies,id', + 'conversion_id' => 'required|exists:currencies,id', + 'rate' => 'required|numeric', + ]; + + /********************************************************************************************** + + RELATIONSHIPS + + **********************************************************************************************/ + + /** + * Get the currency that the conversion is for. + */ + public function currency() { + return $this->belongsTo(Currency::class, 'currency_id'); + } + + /** + * Get the currency that is converted to. + */ + public function convert() { + return $this->belongsTo(Currency::class, 'conversion_id'); + } + + /********************************************************************************************** + + OTHER FUNCTIONS + + **********************************************************************************************/ + + /** + * Gets the ratio based on the decimal conversion rate. + * + * @param mixed $return + */ + public function ratio($return = false) { + $numerator = $this->rate * 100; // Convert rate to avoid floating point issues + $denominator = 100; + $divisor = $this->gcd($numerator, $denominator); // Find GCD to simplify ratio + + // Simplify the ratio + $numerator /= $divisor; + $denominator /= $divisor; + + if ($return) { + return [$numerator, $denominator]; + } + + return $numerator.':'.$denominator; + } + + /** + * Gets the greatest common divisor of two numbers. + * + * @param mixed $a + * @param mixed $b + */ + private function gcd($a, $b) { + return $b ? $this->gcd($b, $a % $b) : $a; + } +} diff --git a/app/Models/Item/Item.php b/app/Models/Item/Item.php index 18fbe51a73..7193a81b95 100644 --- a/app/Models/Item/Item.php +++ b/app/Models/Item/Item.php @@ -405,7 +405,7 @@ public function hasTag($tag) { * * @param mixed $tag * - * @return \App\Models\Item\ItemTag + * @return ItemTag */ public function tag($tag) { return $this->tags()->where('tag', $tag)->where('is_active', 1)->first(); diff --git a/app/Models/Rank/Rank.php b/app/Models/Rank/Rank.php index 83e48eb7d4..34772ea9f9 100644 --- a/app/Models/Rank/Rank.php +++ b/app/Models/Rank/Rank.php @@ -87,7 +87,7 @@ public function getIsAdminAttribute() { /** * Checks if the current rank is high enough to edit a given rank. * - * @param \App\Models\Rank\Rank $rank + * @param Rank $rank * * @return int */ @@ -114,7 +114,7 @@ public function canEditRank($rank) { /** * Checks if the rank has a given power. * - * @param \App\Models\Rank\RankPower $power + * @param RankPower $power * * @return bool */ diff --git a/app/Models/Submission/Submission.php b/app/Models/Submission/Submission.php index e21ccde578..f70595af6d 100644 --- a/app/Models/Submission/Submission.php +++ b/app/Models/Submission/Submission.php @@ -2,6 +2,7 @@ namespace App\Models\Submission; +use App\Models\Gallery\GallerySubmission; use App\Models\Model; use App\Models\Prompt\Prompt; use App\Models\User\User; @@ -194,7 +195,7 @@ public function getInventory($user) { /** * Gets the currencies of the given user for selection. * - * @param \App\Models\User\User $user + * @param User $user * * @return array */ @@ -245,4 +246,15 @@ public function getRewardsAttribute() { return $rewards; } + + /** + * Gets the gallery submission (if there is one). + */ + public function getGallerySubmissionAttribute() { + if (!config('lorekeeper.settings.allow_gallery_submissions_on_prompts') || !isset($this->data['gallery_submission_id'])) { + return null; + } + + return GallerySubmission::find($this->data['gallery_submission_id'] ?? null); + } } diff --git a/app/Models/Trade.php b/app/Models/Trade.php index 58a56c7e88..369070ed6b 100644 --- a/app/Models/Trade.php +++ b/app/Models/Trade.php @@ -142,7 +142,7 @@ public function getCharacterData() { /** * Gets the inventory of the given user for selection. * - * @param \App\Models\User\User $user + * @param User $user * * @return array */ @@ -156,7 +156,7 @@ public function getInventory($user) { /** * Gets the characters of the given user for selection. * - * @param \App\Models\User\User $user + * @param User $user * * @return array */ @@ -173,7 +173,7 @@ public function getCharacters($user) { /** * Gets the currencies of the given user for selection. * - * @param \App\Models\User\User $user + * @param User $user * * @return array */ diff --git a/app/Models/User/User.php b/app/Models/User/User.php index 58f629fd70..9cab26f42e 100644 --- a/app/Models/User/User.php +++ b/app/Models/User/User.php @@ -447,7 +447,7 @@ public function getBirthdayDisplayAttribute() { */ public function getcheckBirthdayAttribute() { $bday = $this->birthday; - if (!$bday || $bday->diffInYears(carbon::now()) < 13) { + if (!$bday || $bday->diffInYears(Carbon::now()) < 13) { return false; } else { return true; @@ -668,7 +668,7 @@ public function getSubmissions($user = null) { * * @param mixed $character * - * @return \App\Models\Character\CharacterBookmark + * @return CharacterBookmark */ public function hasBookmarked($character) { return CharacterBookmark::where('user_id', $this->id)->where('character_id', $character->id)->first(); diff --git a/app/Providers/Socialite/ToyhouseProvider.php b/app/Providers/Socialite/ToyhouseProvider.php index 0ce2bc79cf..2992f2e4d9 100644 --- a/app/Providers/Socialite/ToyhouseProvider.php +++ b/app/Providers/Socialite/ToyhouseProvider.php @@ -57,7 +57,7 @@ protected function getUserByToken($token) { /** * Map the raw user array to a Socialite User instance. * - * @return \Laravel\Socialite\Two\User + * @return User */ protected function mapUserToObject(array $user) { return (new User)->setRaw($user)->map([ diff --git a/app/Services/BookmarkManager.php b/app/Services/BookmarkManager.php index ba03f1293f..8e685e2efe 100644 --- a/app/Services/BookmarkManager.php +++ b/app/Services/BookmarkManager.php @@ -132,7 +132,7 @@ public function deleteBookmark($data, $user) { * Deletes bookmarks associated with a character. * For use when a character is deleted. * - * @param \App\Models\Character\Character $character + * @param Character $character * * @return bool */ diff --git a/app/Services/CharacterCategoryService.php b/app/Services/CharacterCategoryService.php index 8bb6cbc0b3..0416c27a22 100644 --- a/app/Services/CharacterCategoryService.php +++ b/app/Services/CharacterCategoryService.php @@ -61,9 +61,9 @@ public function createCharacterCategory($data, $user) { /** * Update a category. * - * @param \App\Models\Character\CharacterCategory $category - * @param array $data - * @param mixed $user + * @param CharacterCategory $category + * @param array $data + * @param mixed $user * * @return \App\Models\Character\CharacterCategory|bool */ @@ -109,8 +109,8 @@ public function updateCharacterCategory($category, $data, $user) { /** * Delete a category. * - * @param \App\Models\Character\CharacterCategory $category - * @param mixed $user + * @param CharacterCategory $category + * @param mixed $user * * @return bool */ diff --git a/app/Services/CharacterManager.php b/app/Services/CharacterManager.php index 88896066c5..d7a05eb70a 100644 --- a/app/Services/CharacterManager.php +++ b/app/Services/CharacterManager.php @@ -72,9 +72,9 @@ public function pullNumber($categoryId) { /** * Creates a new character or MYO slot. * - * @param array $data - * @param \App\Models\User\User $user - * @param bool $isMyo + * @param array $data + * @param User $user + * @param bool $isMyo * * @return \App\Models\Character\Character|bool */ @@ -188,7 +188,7 @@ public function createCharacter($data, $user, $isMyo = false) { /** * Trims and optionally resizes and watermarks an image. * - * @param \App\Models\Character\CharacterImage $characterImage + * @param CharacterImage $characterImage */ public function processImage($characterImage) { $imageProperties = getimagesize($characterImage->imagePath.'/'.$characterImage->imageFileName); @@ -332,9 +332,9 @@ public function processImage($characterImage) { /** * Crops a thumbnail for the given image. * - * @param array $points - * @param \App\Models\Character\CharacterImage $characterImage - * @param mixed $isMyo + * @param array $points + * @param CharacterImage $characterImage + * @param mixed $isMyo */ public function cropThumbnail($points, $characterImage, $isMyo = false) { $imageProperties = getimagesize($characterImage->imagePath.'/'.$characterImage->imageFileName); @@ -534,9 +534,9 @@ public function createLog($senderId, $senderUrl, $recipientId, $recipientUrl, $c /** * Creates a character image. * - * @param array $data - * @param \App\Models\Character\Character $character - * @param \App\Models\User\User $user + * @param array $data + * @param Character $character + * @param User $user * * @return \App\Models\Character\Character|bool */ @@ -613,9 +613,9 @@ public function createImage($data, $character, $user) { /** * Updates a character image. * - * @param array $data - * @param \App\Models\Character\CharacterImage $image - * @param \App\Models\User\User $user + * @param array $data + * @param CharacterImage $image + * @param User $user * * @return bool */ @@ -702,9 +702,9 @@ public function updateImageFeatures($data, $image, $user) { /** * Updates image data. * - * @param array $data - * @param \App\Models\Character\CharacterImage $image - * @param \App\Models\User\User $user + * @param array $data + * @param CharacterImage $image + * @param User $user * * @return bool */ @@ -738,9 +738,9 @@ public function updateImageNotes($data, $image, $user) { /** * Updates image credits. * - * @param array $data - * @param \App\Models\Character\CharacterImage $image - * @param \App\Models\User\User $user + * @param array $data + * @param CharacterImage $image + * @param User $user * * @return bool */ @@ -830,9 +830,9 @@ public function updateImageCredits($data, $image, $user) { /** * Reuploads an image. * - * @param array $data - * @param \App\Models\Character\CharacterImage $image - * @param \App\Models\User\User $user + * @param array $data + * @param CharacterImage $image + * @param User $user * * @return bool */ @@ -898,9 +898,9 @@ public function reuploadImage($data, $image, $user) { /** * Deletes an image. * - * @param \App\Models\Character\CharacterImage $image - * @param \App\Models\User\User $user - * @param bool $forceDelete + * @param CharacterImage $image + * @param User $user + * @param bool $forceDelete * * @return bool */ @@ -948,9 +948,9 @@ public function deleteImage($image, $user, $forceDelete = false) { /** * Updates image settings. * - * @param array $data - * @param \App\Models\Character\CharacterImage $image - * @param \App\Models\User\User $user + * @param array $data + * @param CharacterImage $image + * @param User $user * * @return bool */ @@ -985,8 +985,8 @@ public function updateImageSettings($data, $image, $user) { /** * Updates a character's active image. * - * @param \App\Models\Character\CharacterImage $image - * @param \App\Models\User\User $user + * @param CharacterImage $image + * @param User $user * * @return bool */ @@ -1023,9 +1023,9 @@ public function updateActiveImage($image, $user) { /** * Sorts a character's images. * - * @param array $data - * @param \App\Models\User\User $user - * @param mixed $character + * @param array $data + * @param User $user + * @param mixed $character * * @return bool */ @@ -1071,8 +1071,8 @@ public function sortImages($data, $character, $user) { /** * Sorts a user's characters. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return bool */ @@ -1105,9 +1105,9 @@ public function sortCharacters($data, $user) { /** * Updates a character's stats. * - * @param array $data - * @param \App\Models\User\User $user - * @param mixed $character + * @param array $data + * @param User $user + * @param mixed $character * * @return bool */ @@ -1208,9 +1208,9 @@ public function updateCharacterStats($data, $character, $user) { /** * Updates a character's description. * - * @param array $data - * @param \App\Models\Character\Character $character - * @param \App\Models\User\User $user + * @param array $data + * @param Character $character + * @param User $user * * @return bool */ @@ -1244,9 +1244,9 @@ public function updateCharacterDescription($data, $character, $user) { /** * Updates a character's settings. * - * @param array $data - * @param \App\Models\User\User $user - * @param mixed $character + * @param array $data + * @param User $user + * @param mixed $character * * @return bool */ @@ -1278,10 +1278,10 @@ public function updateCharacterSettings($data, $character, $user) { /** * Updates a character's profile. * - * @param array $data - * @param \App\Models\Character\Character $character - * @param \App\Models\User\User $user - * @param bool $isAdmin + * @param array $data + * @param Character $character + * @param User $user + * @param bool $isAdmin * * @return bool */ @@ -1365,8 +1365,8 @@ public function updateCharacterProfile($data, $character, $user, $isAdmin = fals /** * Deletes a character. * - * @param \App\Models\Character\Character $character - * @param \App\Models\User\User $user + * @param Character $character + * @param User $user * * @return bool */ @@ -1417,9 +1417,9 @@ public function deleteCharacter($character, $user) { /** * Creates a character transfer. * - * @param array $data - * @param \App\Models\Character\Character $character - * @param \App\Models\User\User $user + * @param array $data + * @param Character $character + * @param User $user * * @return bool */ @@ -1493,9 +1493,9 @@ public function createTransfer($data, $character, $user) { /** * Forces an admin transfer of a character. * - * @param array $data - * @param \App\Models\Character\Character $character - * @param \App\Models\User\User $user + * @param array $data + * @param Character $character + * @param User $user * * @return bool */ @@ -1575,8 +1575,8 @@ public function adminTransfer($data, $character, $user) { /** * Processes a character transfer. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return bool */ @@ -1643,8 +1643,8 @@ public function processTransfer($data, $user) { /** * Cancels a character transfer. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return bool */ @@ -1679,8 +1679,8 @@ public function cancelTransfer($data, $user) { /** * Processes a character transfer in the approvals queue. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return bool */ @@ -1775,11 +1775,11 @@ public function processTransferQueue($data, $user) { /** * Moves a character from one user to another. * - * @param \App\Models\Character\Character $character - * @param \App\Models\User\User $recipient - * @param string $data - * @param int $cooldown - * @param string $logType + * @param Character $character + * @param User $recipient + * @param string $data + * @param int $cooldown + * @param string $logType */ public function moveCharacter($character, $recipient, $data, $cooldown = -1, $logType = null) { $sender = $character->user; @@ -1917,7 +1917,7 @@ private function handleCharacter($data, $isMyo = false) { * @param bool $isMyo * @param mixed $character * - * @return \App\Models\Character\Character $character + * @return Character $character * @return \App\Models\Character\CharacterImage|bool */ private function handleCharacterImage($data, $character, $isMyo = false) { @@ -2056,7 +2056,7 @@ private function handleCharacterImage($data, $character, $isMyo = false) { /** * Generates a list of features for displaying. * - * @param \App\Models\Character\CharacterImage $image + * @param CharacterImage $image * * @return string */ @@ -2072,7 +2072,7 @@ private function generateFeatureList($image) { /** * Generates a list of image credits for displaying. * - * @param \App\Models\Character\CharacterImage $image + * @param CharacterImage $image * * @return string */ diff --git a/app/Services/CurrencyManager.php b/app/Services/CurrencyManager.php index 2ea9c08041..f11dd9e8dc 100644 --- a/app/Services/CurrencyManager.php +++ b/app/Services/CurrencyManager.php @@ -5,6 +5,7 @@ use App\Facades\Notifications; use App\Models\Character\CharacterCurrency; use App\Models\Currency\Currency; +use App\Models\Currency\CurrencyConversion; use App\Models\User\User; use App\Models\User\UserCurrency; use Carbon\Carbon; @@ -23,8 +24,8 @@ class CurrencyManager extends Service { /** * Admin function for granting currency to multiple users. * - * @param array $data - * @param \App\Models\User\User $staff + * @param array $data + * @param User $staff * * @return bool */ @@ -93,7 +94,7 @@ public function grantUserCurrencies($data, $staff) { * * @param array $data * @param \App\Models\Character\Character $staff - * @param \App\Models\User\User $staff + * @param User $staff * @param mixed $character * * @return bool @@ -155,10 +156,10 @@ public function grantCharacterCurrencies($data, $character, $staff) { /** * Transfers currency between users. * - * @param \App\Models\User\User $sender - * @param \App\Models\User\User $recipient - * @param \App\Models\Currency\Currency $currency - * @param int $quantity + * @param User $sender + * @param User $recipient + * @param Currency $currency + * @param int $quantity * * @return bool */ @@ -207,7 +208,7 @@ public function transferCurrency($sender, $recipient, $currency, $quantity) { * * @param \App\Models\Character\Character|\App\Models\User\User $sender * @param \App\Models\Character\Character|\App\Models\User\User $recipient - * @param \App\Models\Currency\Currency $currency + * @param Currency $currency * @param int $quantity * * @return bool @@ -255,7 +256,7 @@ public function transferCharacterCurrency($sender, $recipient, $currency, $quant * @param \App\Models\Character\Character|\App\Models\User\User $recipient * @param string $type * @param string $data - * @param \App\Models\Currency\Currency $currency + * @param Currency $currency * @param int $quantity * * @return bool @@ -312,7 +313,7 @@ public function creditCurrency($sender, $recipient, $type, $data, $currency, $qu * @param \App\Models\Character\Character|\App\Models\User\User $recipient * @param string $type * @param string $data - * @param \App\Models\Currency\Currency $currency + * @param Currency $currency * @param int $quantity * * @return bool @@ -360,6 +361,73 @@ public function debitCurrency($sender, $recipient, $type, $data, $currency, $qua return $this->rollbackReturn(false); } + /** + * Converts currency from one type to another. + * + * @param Currency $currency + * @param Currency $conversion + * @param int $quantity + * @param User $user + * + * @return bool + */ + public function convertCurrency($currency, $conversion, $quantity, $user) { + DB::beginTransaction(); + + try { + if (!$currency) { + throw new \Exception('Invalid currency selected.'); + } + if (!$conversion) { + throw new \Exception('Invalid conversion selected.'); + } + if ($quantity <= 0) { + throw new \Exception('Invalid quantity entered.'); + } + + // first make sure that quantity is in the appropriate ratio + $conversion_rate = CurrencyConversion::where('currency_id', $currency->id)->where('conversion_id', $conversion->id)->first(); + + if (!$conversion_rate) { + throw new \Exception('Invalid conversion.'); + } + + $ratio = $conversion_rate->ratio(true); + + // make sure the quantity is in the appropriate ratio + if ($quantity % $ratio[0] != 0) { + throw new \Exception('Invalid quantity entered, must be in multiples of '.$ratio[0].'.'); + } + + // make sure the user has enough of the currency to convert + $record = UserCurrency::where('user_id', $user->id)->where('currency_id', $currency->id)->first(); + if (!$record || $record->quantity < $quantity) { + throw new \Exception('Not enough '.$currency->name.' to carry out this action.'); + } + + // save log since we change quantity later + $log = 'Converted '.$quantity.' '.$currency->displayName.' to '.$conversion->displayName; + + // remove the currency + if (!$this->debitCurrency($user, null, 'Currency Conversion', $log, $currency, $quantity)) { + throw new \Exception('Failed to debit currency.'); + } + + $quantity = intval($quantity / $ratio[0] * $ratio[1]); + + // add the converted currency + if (!$this->creditCurrency(null, $user, 'Currency Conversion', $log, $conversion, $quantity)) { + throw new \Exception('Failed to credit currency.'); + } + + return $this->commitReturn(true); + } catch (\Exception $e) { + $this->setError('error', $e->getMessage()); + } + + return $this->rollbackReturn(false); + } + /** * Creates a currency log. * diff --git a/app/Services/CurrencyService.php b/app/Services/CurrencyService.php index 55bd53534b..d33844e093 100644 --- a/app/Services/CurrencyService.php +++ b/app/Services/CurrencyService.php @@ -78,9 +78,9 @@ public function createCurrency($data, $user) { /** * Updates a currency. * - * @param \App\Models\Currency\Currency $currency - * @param array $data - * @param \App\Models\User\User $user + * @param Currency $currency + * @param array $data + * @param \App\Models\User\User $user * * @return \App\Models\Currency\Currency|bool */ @@ -117,6 +117,8 @@ public function updateCurrency($currency, $data, $user) { $currency->update($data); + $this->populateConversions($currency, $data); + if (!$this->logAdminAction($user, 'Updated Currency', 'Updated '.$currency->displayName)) { throw new \Exception('Failed to log admin action.'); } @@ -139,8 +141,8 @@ public function updateCurrency($currency, $data, $user) { /** * Deletes a currency. * - * @param \App\Models\Currency\Currency $currency - * @param mixed $user + * @param Currency $currency + * @param mixed $user * * @return bool */ @@ -217,8 +219,8 @@ public function sortCurrency($data, $type) { /** * Processes user input for creating/updating a currency. * - * @param array $data - * @param \App\Models\Currency\Currency $currency + * @param array $data + * @param Currency $currency * * @return array */ @@ -275,4 +277,26 @@ private function populateData($data, $currency = null) { return $data; } + + /** + * Processes user input for creating/updating a currency's conversions. + * + * @param Currency $currency + * @param array $data + */ + private function populateConversions($currency, $data) { + $currency->conversions()->delete(); + if (isset($data['conversion_id']) && $data['conversion_id']) { + foreach ($data['conversion_id'] as $key => $conversion_id) { + $conversion = Currency::find($conversion_id); + if (!$conversion) { + continue; + } + $currency->conversions()->create([ + 'conversion_id' => $conversion_id, + 'rate' => $data['rate'][$key] ?? 1.00, + ]); + } + } + } } diff --git a/app/Services/DesignUpdateManager.php b/app/Services/DesignUpdateManager.php index b2a65257d4..7740740d52 100644 --- a/app/Services/DesignUpdateManager.php +++ b/app/Services/DesignUpdateManager.php @@ -34,8 +34,8 @@ class DesignUpdateManager extends Service { /** * Creates a character design update request (or a MYO design approval request). * - * @param \App\Models\Character\Character $character - * @param \App\Models\User\User $user + * @param Character $character + * @param User $user * * @return \App\Models\Character\CharacterDesignUpdate|bool */ @@ -95,8 +95,8 @@ public function createDesignUpdateRequest($character, $user) { /** * Saves the comment section of a character design update request. * - * @param array $data - * @param \App\Models\Character\CharacterDesignUpdate $request + * @param array $data + * @param CharacterDesignUpdate $request * * @return bool */ @@ -120,9 +120,9 @@ public function saveRequestComment($data, $request) { /** * Saves the image upload section of a character design update request. * - * @param array $data - * @param \App\Models\Character\CharacterDesignUpdate $request - * @param bool $isAdmin + * @param array $data + * @param CharacterDesignUpdate $request + * @param bool $isAdmin * * @return bool */ @@ -234,8 +234,8 @@ public function saveRequestImage($data, $request, $isAdmin = false) { /** * Saves the addons section of a character design update request. * - * @param array $data - * @param \App\Models\Character\CharacterDesignUpdate $request + * @param array $data + * @param CharacterDesignUpdate $request * * @return bool */ @@ -346,8 +346,8 @@ public function saveRequestAddons($data, $request) { /** * Saves the character features (traits) section of a character design update request. * - * @param array $data - * @param \App\Models\Character\CharacterDesignUpdate $request + * @param array $data + * @param CharacterDesignUpdate $request * * @return bool */ @@ -431,7 +431,7 @@ public function saveRequestFeatures($data, $request) { /** * Submit a character design update request to the approval queue. * - * @param \App\Models\Character\CharacterDesignUpdate $request + * @param CharacterDesignUpdate $request * * @return bool */ @@ -468,9 +468,9 @@ public function submitRequest($request) { /** * Approves a character design update request and processes it. * - * @param array $data - * @param \App\Models\Character\CharacterDesignUpdate $request - * @param \App\Models\User\User $user + * @param array $data + * @param CharacterDesignUpdate $request + * @param User $user * * @return bool */ @@ -732,11 +732,11 @@ public function approveRequest($data, $request, $user) { * Rejection can be a soft rejection (reopens the request so the user can edit it and resubmit) * or a hard rejection (takes the request out of the queue completely). * - * @param array $data - * @param \App\Models\Character\CharacterDesignUpdate $request - * @param \App\Models\User\User $user - * @param bool $forceReject - * @param mixed $notification + * @param array $data + * @param CharacterDesignUpdate $request + * @param User $user + * @param bool $forceReject + * @param mixed $notification * * @return bool */ @@ -822,9 +822,9 @@ public function rejectRequest($data, $request, $user, $forceReject = false, $not /** * Cancels a character design update request. * - * @param array $data - * @param \App\Models\Character\CharacterDesignUpdate $request - * @param \App\Models\User\User $user + * @param array $data + * @param CharacterDesignUpdate $request + * @param User $user * * @return bool */ @@ -872,7 +872,7 @@ public function cancelRequest($data, $request, $user) { /** * Deletes a character design update request. * - * @param \App\Models\Character\CharacterDesignUpdate $request + * @param CharacterDesignUpdate $request * * @return bool */ @@ -943,9 +943,9 @@ public function deleteRequest($request) { /** * Votes on a character design update request. * - * @param string $action - * @param \App\Models\Character\CharacterDesignUpdate $request - * @param \App\Models\User\User $user + * @param string $action + * @param CharacterDesignUpdate $request + * @param User $user * * @return bool */ diff --git a/app/Services/FeatureService.php b/app/Services/FeatureService.php index 76b7cbc3f8..8662ca5431 100644 --- a/app/Services/FeatureService.php +++ b/app/Services/FeatureService.php @@ -69,9 +69,9 @@ public function createFeatureCategory($data, $user) { /** * Update a category. * - * @param \App\Models\Feature\FeatureCategory $category - * @param array $data - * @param \App\Models\User\User $user + * @param FeatureCategory $category + * @param array $data + * @param \App\Models\User\User $user * * @return \App\Models\Feature\FeatureCategory|bool */ @@ -119,8 +119,8 @@ public function updateFeatureCategory($category, $data, $user) { /** * Delete a category. * - * @param \App\Models\Feature\FeatureCategory $category - * @param mixed $user + * @param FeatureCategory $category + * @param mixed $user * * @return bool */ @@ -253,9 +253,9 @@ public function createFeature($data, $user) { /** * Updates a feature. * - * @param \App\Models\Feature\Feature $feature - * @param array $data - * @param \App\Models\User\User $user + * @param Feature $feature + * @param array $data + * @param \App\Models\User\User $user * * @return \App\Models\Feature\Feature|bool */ @@ -324,8 +324,8 @@ public function updateFeature($feature, $data, $user) { /** * Deletes a feature. * - * @param \App\Models\Feature\Feature $feature - * @param mixed $user + * @param Feature $feature + * @param mixed $user * * @return bool */ @@ -386,8 +386,8 @@ private function populateCategoryData($data, $category = null) { /** * Processes user input for creating/updating a feature. * - * @param array $data - * @param \App\Models\Feature\Feature $feature + * @param array $data + * @param Feature $feature * * @return array */ diff --git a/app/Services/GalleryManager.php b/app/Services/GalleryManager.php index b6daf78ae3..121c2c4d27 100644 --- a/app/Services/GalleryManager.php +++ b/app/Services/GalleryManager.php @@ -30,9 +30,9 @@ class GalleryManager extends Service { /** * Creates a new gallery submission. * - * @param array $data - * @param array $currencyFormData - * @param \App\Models\User\User $user + * @param array $data + * @param array $currencyFormData + * @param User $user * * @return \App\Models\Gallery\GallerySubmission|bool */ @@ -174,9 +174,9 @@ public function createSubmission($data, $currencyFormData, $user) { /** * Updates a gallery submission. * - * @param \App\Models\Gallery\GallerySubmission $submission - * @param array $data - * @param \App\Models\User\User $user + * @param GallerySubmission $submission + * @param array $data + * @param User $user * * @return \App\Models\Gallery\GallerySubmission|bool */ @@ -338,9 +338,9 @@ public function updateSubmission($submission, $data, $user) { /** * Processes collaborator edits/approvals on a submission. * - * @param \App\Models\Gallery\GallerySubmission $submission - * @param \App\Models\User\User $user - * @param mixed $data + * @param GallerySubmission $submission + * @param User $user + * @param mixed $data * * @return \App\Models\Gallery\GalleryFavorite|bool */ @@ -393,9 +393,9 @@ public function editCollaborator($submission, $data, $user) { /** * Votes on a gallery submission. * - * @param string $action - * @param \App\Models\Gallery\GallerySubmission $submission - * @param \App\Models\User\User $user + * @param string $action + * @param GallerySubmission $submission + * @param User $user * * @return bool */ @@ -466,9 +466,9 @@ public function castVote($action, $submission, $user) { /** * Processes staff comments for a submission. * - * @param \App\Models\User\User $user - * @param mixed $id - * @param mixed $data + * @param User $user + * @param mixed $id + * @param mixed $data * * @return \App\Models\Gallery\GalleryFavorite|bool */ @@ -516,8 +516,8 @@ public function postStaffComments($id, $data, $user) { /** * Archives a submission. * - * @param \App\Models\Gallery\GallerySubmission $submission - * @param mixed $user + * @param GallerySubmission $submission + * @param mixed $user * * @return bool */ @@ -555,9 +555,9 @@ public function archiveSubmission($submission, $user) { /** * Processes group currency evaluation for a submission. * - * @param \App\Models\User\User $user - * @param mixed $id - * @param mixed $data + * @param User $user + * @param mixed $id + * @param mixed $data * * @return \App\Models\Gallery\GalleryFavorite|bool */ @@ -689,8 +689,8 @@ public function postValueSubmission($id, $data, $user) { /** * Toggles favorite status on a submission for a user. * - * @param \App\Models\Gallery\GallerySubmission $submission - * @param \App\Models\User\User $user + * @param GallerySubmission $submission + * @param User $user * * @return \App\Models\Gallery\GalleryFavorite|bool */ @@ -737,8 +737,8 @@ public function favoriteSubmission($submission, $user) { /** * Processes rejection for a submission. * - * @param \App\Models\Gallery\GallerySubmission $submission - * @param mixed $user + * @param GallerySubmission $submission + * @param mixed $user * * @return \App\Models\Gallery\GallerySubmission|bool */ @@ -795,8 +795,8 @@ private function populateData($data) { /** * Processes gallery submission images. * - * @param array $data - * @param \App\Models\Gallery\GallerySubmission $submission + * @param array $data + * @param GallerySubmission $submission * * @return array */ @@ -856,7 +856,7 @@ private function processImage($data, $submission) { /** * Processes acceptance for a submission. * - * @param \App\Models\Gallery\GallerySubmission $submission + * @param GallerySubmission $submission * * @return \App\Models\Gallery\GallerySubmission|bool */ diff --git a/app/Services/InventoryManager.php b/app/Services/InventoryManager.php index 652b2bdc8f..2dd8b20d31 100644 --- a/app/Services/InventoryManager.php +++ b/app/Services/InventoryManager.php @@ -24,8 +24,8 @@ class InventoryManager extends Service { /** * Grants an item to multiple users. * - * @param array $data - * @param \App\Models\User\User $staff + * @param array $data + * @param User $staff * * @return bool */ @@ -89,7 +89,7 @@ public function grantItems($data, $staff) { * * @param array $data * @param \App\Models\Character\Character $character - * @param \App\Models\User\User $staff + * @param User $staff * * @return bool */ @@ -239,10 +239,10 @@ public function transferCharacterStack($sender, $recipient, $stacks, $quantities /** * Transfers items between user stacks. * - * @param \App\Models\User\User $sender - * @param \App\Models\User\User $recipient - * @param \App\Models\User\UserItem $stacks - * @param int $quantities + * @param User $sender + * @param User $recipient + * @param UserItem $stacks + * @param int $quantities * * @return bool */ @@ -392,9 +392,9 @@ public function deleteStack($owner, $stacks, $quantities, $user) { /** * Sells items from stack. * - * @param \App\Models\User\User $user - * @param \App\Models\User\UserItem $stacks - * @param int $quantities + * @param User $user + * @param UserItem $stacks + * @param int $quantities * * @return bool */ @@ -462,7 +462,7 @@ public function resellStack($user, $stacks, $quantities) { * @param \App\Models\Character\Character|\App\Models\User\User $recipient * @param string $type * @param array $data - * @param \App\Models\Item\Item $item + * @param Item $item * @param int $quantity * * @return bool @@ -664,7 +664,7 @@ public function createLog($senderId, $senderType, $recipientId, $recipientType, /** * Consolidates a user's item stacks. * - * @param \App\Models\User\User $user + * @param User $user * * @return bool */ diff --git a/app/Services/InvitationService.php b/app/Services/InvitationService.php index 544e503b27..feb62ff38c 100644 --- a/app/Services/InvitationService.php +++ b/app/Services/InvitationService.php @@ -70,7 +70,7 @@ public function useInvitation($invitation, $user) { /** * Deletes an unused invitation code. * - * @param \App\Models\Invitation $invitation + * @param Invitation $invitation * * @return bool */ diff --git a/app/Services/Item/SlotService.php b/app/Services/Item/SlotService.php index e3b9c73744..caa9dd3a8b 100644 --- a/app/Services/Item/SlotService.php +++ b/app/Services/Item/SlotService.php @@ -118,7 +118,7 @@ public function updateData($tag, $data) { * Acts upon the item when used from the inventory. * * @param \App\Models\User\UserItem $stacks - * @param \App\Models\User\User $user + * @param User $user * @param array $data * * @return bool diff --git a/app/Services/ItemService.php b/app/Services/ItemService.php index 13ceb31e7e..4527bf4f03 100644 --- a/app/Services/ItemService.php +++ b/app/Services/ItemService.php @@ -68,9 +68,9 @@ public function createItemCategory($data, $user) { /** * Update a category. * - * @param \App\Models\Item\ItemCategory $category - * @param array $data - * @param \App\Models\User\User $user + * @param ItemCategory $category + * @param array $data + * @param \App\Models\User\User $user * * @return \App\Models\Item\ItemCategory|bool */ @@ -114,8 +114,8 @@ public function updateItemCategory($category, $data, $user) { /** * Delete a category. * - * @param \App\Models\Item\ItemCategory $category - * @param mixed $user + * @param ItemCategory $category + * @param mixed $user * * @return bool */ @@ -239,7 +239,7 @@ public function createItem($data, $user) { /** * Updates an item. * - * @param \App\Models\Item\Item $item + * @param Item $item * @param array $data * @param \App\Models\User\User $user * @@ -302,8 +302,8 @@ public function updateItem($item, $data, $user) { /** * Deletes an item. * - * @param \App\Models\Item\Item $item - * @param mixed $user + * @param Item $item + * @param mixed $user * * @return bool */ @@ -373,9 +373,9 @@ public function getItemTags() { /** * Adds an item tag to an item. * - * @param \App\Models\Item\Item $item - * @param string $tag - * @param mixed $user + * @param Item $item + * @param string $tag + * @param mixed $user * * @return bool|string */ @@ -413,10 +413,10 @@ public function addItemTag($item, $tag, $user) { /** * Edits the data associated with an item tag on an item. * - * @param \App\Models\Item\Item $item - * @param string $tag - * @param array $data - * @param mixed $user + * @param Item $item + * @param string $tag + * @param array $data + * @param mixed $user * * @return bool|string */ @@ -458,9 +458,9 @@ public function editItemTag($item, $tag, $data, $user) { /** * Removes an item tag from an item. * - * @param \App\Models\Item\Item $item - * @param string $tag - * @param mixed $user + * @param Item $item + * @param string $tag + * @param mixed $user * * @return bool|string */ @@ -526,8 +526,8 @@ private function populateCategoryData($data, $category = null) { /** * Processes user input for creating/updating an item. * - * @param array $data - * @param \App\Models\Item\Item $item + * @param array $data + * @param Item $item * * @return array */ diff --git a/app/Services/LootService.php b/app/Services/LootService.php index 9b18d7c669..662012717f 100644 --- a/app/Services/LootService.php +++ b/app/Services/LootService.php @@ -68,8 +68,8 @@ public function createLootTable($data) { /** * Updates a loot table. * - * @param \App\Models\Loot\LootTable $table - * @param array $data + * @param LootTable $table + * @param array $data * * @return \App\Models\Loot\LootTable|bool */ @@ -116,7 +116,7 @@ public function updateLootTable($table, $data) { /** * Deletes a loot table. * - * @param \App\Models\Loot\LootTable $table + * @param LootTable $table * * @return bool */ @@ -145,8 +145,8 @@ public function deleteLootTable($table) { /** * Handles the creation of loot for a loot table. * - * @param \App\Models\Loot\LootTable $table - * @param array $data + * @param LootTable $table + * @param array $data */ private function populateLootTable($table, $data) { // Clear the old loot... diff --git a/app/Services/NewsService.php b/app/Services/NewsService.php index 5a40a17426..ef7b43103e 100644 --- a/app/Services/NewsService.php +++ b/app/Services/NewsService.php @@ -19,8 +19,8 @@ class NewsService extends Service { /** * Creates a news post. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return \App\Models\News|bool */ @@ -51,9 +51,9 @@ public function createNews($data, $user) { /** * Updates a news post. * - * @param \App\Models\News $news - * @param array $data - * @param \App\Models\User\User $user + * @param News $news + * @param array $data + * @param User $user * * @return \App\Models\News|bool */ @@ -83,7 +83,7 @@ public function updateNews($news, $data, $user) { /** * Deletes a news post. * - * @param \App\Models\News $news + * @param News $news * * @return bool */ diff --git a/app/Services/PromptService.php b/app/Services/PromptService.php index 2ff79be1f9..f157137417 100644 --- a/app/Services/PromptService.php +++ b/app/Services/PromptService.php @@ -66,9 +66,9 @@ public function createPromptCategory($data, $user) { /** * Update a category. * - * @param \App\Models\Prompt\PromptCategory $category - * @param array $data - * @param \App\Models\User\User $user + * @param PromptCategory $category + * @param array $data + * @param \App\Models\User\User $user * * @return \App\Models\Prompt\PromptCategory|bool */ @@ -108,7 +108,7 @@ public function updatePromptCategory($category, $data, $user) { /** * Delete a category. * - * @param \App\Models\Prompt\PromptCategory $category + * @param PromptCategory $category * * @return bool */ @@ -221,9 +221,9 @@ public function createPrompt($data, $user) { /** * Updates a prompt. * - * @param \App\Models\Prompt\Prompt $prompt - * @param array $data - * @param \App\Models\User\User $user + * @param Prompt $prompt + * @param array $data + * @param \App\Models\User\User $user * * @return \App\Models\Prompt\Prompt|bool */ @@ -279,7 +279,7 @@ public function updatePrompt($prompt, $data, $user) { /** * Deletes a prompt. * - * @param \App\Models\Prompt\Prompt $prompt + * @param Prompt $prompt * * @return bool */ @@ -335,8 +335,8 @@ private function populateCategoryData($data, $category = null) { /** * Processes user input for creating/updating a prompt. * - * @param array $data - * @param \App\Models\Prompt\Prompt $prompt + * @param array $data + * @param Prompt $prompt * * @return array */ @@ -372,8 +372,8 @@ private function populateData($data, $prompt = null) { /** * Processes user input for creating/updating prompt rewards. * - * @param array $data - * @param \App\Models\Prompt\Prompt $prompt + * @param array $data + * @param Prompt $prompt */ private function populateRewards($data, $prompt) { // Clear the old rewards... diff --git a/app/Services/RaffleManager.php b/app/Services/RaffleManager.php index c23af2971a..587e556644 100644 --- a/app/Services/RaffleManager.php +++ b/app/Services/RaffleManager.php @@ -21,8 +21,8 @@ class RaffleManager extends Service { /** * Adds tickets to a raffle. * - * @param \App\Models\Raffle\Raffle $raffle - * @param array $data + * @param Raffle $raffle + * @param array $data * * @return int */ @@ -46,9 +46,9 @@ public function addTickets($raffle, $data) { /** * Adds one or more tickets to a single user for a raffle. * - * @param \App\Models\User\User $user - * @param \App\Models\Raffle\Raffle $raffle - * @param int $count + * @param User $user + * @param Raffle $raffle + * @param int $count * * @return int */ @@ -80,7 +80,7 @@ public function addTicket($user, $raffle, $count = 1) { /** * Removes a single ticket. * - * @param \App\Models\Raffle\RaffleTicket $ticket + * @param RaffleTicket $ticket * * @return bool */ @@ -130,8 +130,8 @@ public function rollRaffleGroup($raffleGroup, $updateGroup = true) { * If the $updateGroup flag is true, winners will be removed * from other raffles in the group. * - * @param \App\Models\Raffle\Raffle $raffle - * @param bool $updateGroup + * @param Raffle $raffle + * @param bool $updateGroup * * @return bool */ @@ -165,7 +165,7 @@ public function rollRaffle($raffle, $updateGroup = false) { /** * Rolls the winners of a raffle. * - * @param \App\Models\Raffle\Raffle $raffle + * @param Raffle $raffle * * @return array */ @@ -215,7 +215,7 @@ private function rollWinners($raffle) { * * @param array $winners * @param \App\Models\Raffle\RaffleGroup $raffleGroup - * @param \App\Models\Raffle\Raffle $raffle + * @param Raffle $raffle * * @return bool */ diff --git a/app/Services/RaffleService.php b/app/Services/RaffleService.php index 7ef66661ff..db17e8d98b 100644 --- a/app/Services/RaffleService.php +++ b/app/Services/RaffleService.php @@ -22,7 +22,7 @@ class RaffleService extends Service { * * @param array $data * - * @return \App\Models\Raffle\Raffle + * @return Raffle */ public function createRaffle($data) { DB::beginTransaction(); @@ -38,10 +38,10 @@ public function createRaffle($data) { /** * Updates a raffle. * - * @param array $data - * @param \App\Models\Raffle\Raffle $raffle + * @param array $data + * @param Raffle $raffle * - * @return \App\Models\Raffle\Raffle + * @return Raffle */ public function updateRaffle($data, $raffle) { DB::beginTransaction(); @@ -57,7 +57,7 @@ public function updateRaffle($data, $raffle) { /** * Deletes a raffle. * - * @param \App\Models\Raffle\Raffle $raffle + * @param Raffle $raffle * * @return bool */ @@ -77,7 +77,7 @@ public function deleteRaffle($raffle) { * * @param array $data * - * @return \App\Models\Raffle\RaffleGroup + * @return RaffleGroup */ public function createRaffleGroup($data) { DB::beginTransaction(); @@ -96,7 +96,7 @@ public function createRaffleGroup($data) { * @param array $data * @param mixed $group * - * @return \App\Models\Raffle\Raffle + * @return Raffle */ public function updateRaffleGroup($data, $group) { DB::beginTransaction(); diff --git a/app/Services/RankService.php b/app/Services/RankService.php index 4cf1cedb51..3313bb2912 100644 --- a/app/Services/RankService.php +++ b/app/Services/RankService.php @@ -19,8 +19,8 @@ class RankService extends Service { /** * Creates a user rank. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return bool */ @@ -76,9 +76,9 @@ public function createRank($data, $user) { /** * Updates a user rank. * - * @param \App\Models\Rank\Rank $rank - * @param array $data - * @param \App\Models\User\User $user + * @param Rank $rank + * @param array $data + * @param User $user * * @return bool */ @@ -129,8 +129,8 @@ public function updateRank($rank, $data, $user) { /** * Deletes a user rank. * - * @param \App\Models\Rank\Rank $rank - * @param \App\Models\User\User $user + * @param Rank $rank + * @param User $user * * @return bool */ @@ -157,8 +157,8 @@ public function deleteRank($rank, $user) { /** * Sorts user ranks. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return bool */ diff --git a/app/Services/RarityService.php b/app/Services/RarityService.php index 89ae7bfbff..88cd7b3fd3 100644 --- a/app/Services/RarityService.php +++ b/app/Services/RarityService.php @@ -58,7 +58,7 @@ public function createRarity($data, $user) { /** * Updates a rarity. * - * @param \App\Models\Rarity $rarity + * @param Rarity $rarity * @param array $data * @param \App\Models\User\User $user * @@ -100,7 +100,7 @@ public function updateRarity($rarity, $data, $user) { /** * Deletes a rarity. * - * @param \App\Models\Rarity $rarity + * @param Rarity $rarity * * @return bool */ @@ -155,8 +155,8 @@ public function sortRarity($data) { /** * Processes user input for creating/updating a rarity. * - * @param array $data - * @param \App\Models\Rarity $rarity + * @param array $data + * @param Rarity $rarity * * @return array */ diff --git a/app/Services/SalesService.php b/app/Services/SalesService.php index f5a6f25a87..a62a4c74a6 100644 --- a/app/Services/SalesService.php +++ b/app/Services/SalesService.php @@ -22,8 +22,8 @@ class SalesService extends Service { /** * Creates a Sales post. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return \App\Models\Sales\Sales|bool */ @@ -73,9 +73,9 @@ public function createSales($data, $user) { /** * Updates a Sales post. * - * @param array $data - * @param \App\Models\User\User $user - * @param mixed $sales + * @param array $data + * @param User $user + * @param mixed $sales * * @return \App\Models\Sales\Sales|bool */ diff --git a/app/Services/ShopManager.php b/app/Services/ShopManager.php index db5eb627c2..749e4f9050 100644 --- a/app/Services/ShopManager.php +++ b/app/Services/ShopManager.php @@ -134,8 +134,8 @@ public function buyStock($data, $user) { /** * Checks if the purchase limit for an item from a shop has been reached. * - * @param \App\Models\Shop\ShopStock $shopStock - * @param \App\Models\User\User $user + * @param ShopStock $shopStock + * @param \App\Models\User\User $user * * @return bool */ @@ -150,8 +150,8 @@ public function checkPurchaseLimitReached($shopStock, $user) { /** * Checks how many times a user has purchased a shop item. * - * @param \App\Models\Shop\ShopStock $shopStock - * @param \App\Models\User\User $user + * @param ShopStock $shopStock + * @param \App\Models\User\User $user * * @return int */ diff --git a/app/Services/ShopService.php b/app/Services/ShopService.php index 5f567282b7..852d765640 100644 --- a/app/Services/ShopService.php +++ b/app/Services/ShopService.php @@ -62,7 +62,7 @@ public function createShop($data, $user) { /** * Updates a shop. * - * @param \App\Models\Shop\Shop $shop + * @param Shop $shop * @param array $data * @param \App\Models\User\User $user * @@ -104,7 +104,7 @@ public function updateShop($shop, $data, $user) { /** * Updates shop stock. * - * @param \App\Models\Shop\Shop $shop + * @param Shop $shop * @param array $data * @param \App\Models\User\User $user * @@ -156,7 +156,7 @@ public function updateShopStock($shop, $data, $user) { /** * Deletes a shop. * - * @param \App\Models\Shop\Shop $shop + * @param Shop $shop * * @return bool */ @@ -209,8 +209,8 @@ public function sortShop($data) { /** * Processes user input for creating/updating a shop. * - * @param array $data - * @param \App\Models\Shop\Shop $shop + * @param array $data + * @param Shop $shop * * @return array */ diff --git a/app/Services/SpeciesService.php b/app/Services/SpeciesService.php index 3165d0a311..2b02fabaf2 100644 --- a/app/Services/SpeciesService.php +++ b/app/Services/SpeciesService.php @@ -59,9 +59,9 @@ public function createSpecies($data, $user) { /** * Updates a species. * - * @param \App\Models\Species\Species $species - * @param array $data - * @param \App\Models\User\User $user + * @param Species $species + * @param array $data + * @param \App\Models\User\User $user * * @return \App\Models\Species\Species|bool */ @@ -101,7 +101,7 @@ public function updateSpecies($species, $data, $user) { /** * Deletes a species. * - * @param \App\Models\Species\Species $species + * @param Species $species * * @return bool */ @@ -194,9 +194,9 @@ public function createSubtype($data, $user) { /** * Updates a subtype. * - * @param \App\Models\Species\Subtype $subtype - * @param array $data - * @param \App\Models\User\User $user + * @param Subtype $subtype + * @param array $data + * @param \App\Models\User\User $user * * @return \App\Models\Species\Subtype|bool */ @@ -231,7 +231,7 @@ public function updateSubtype($subtype, $data, $user) { /** * Deletes a subtype. * - * @param \App\Models\Species\Subtype $subtype + * @param Subtype $subtype * * @return bool */ @@ -286,8 +286,8 @@ public function sortSubtypes($data) { /** * Processes user input for creating/updating a species. * - * @param array $data - * @param \App\Models\Species\Species $species + * @param array $data + * @param Species $species * * @return array */ @@ -313,8 +313,8 @@ private function populateData($data, $species = null) { /** * Processes user input for creating/updating a subtype. * - * @param array $data - * @param \App\Models\Species\Subtype $subtype + * @param array $data + * @param Subtype $subtype * * @return array */ diff --git a/app/Services/SublistService.php b/app/Services/SublistService.php index 25c16f266c..e12fde1676 100644 --- a/app/Services/SublistService.php +++ b/app/Services/SublistService.php @@ -56,9 +56,9 @@ public function createSublist($data, $contents) { /** * Update a sublist. * - * @param \App\Models\Character\Sublist $sublist - * @param array $data - * @param array $contents + * @param Sublist $sublist + * @param array $data + * @param array $contents * * @return \App\Models\Character\Sublist|bool */ @@ -95,7 +95,7 @@ public function updateSublist($sublist, $data, $contents) { /** * Delete a sublist. * - * @param \App\Models\Character\Sublist $sublist + * @param Sublist $sublist * * @return bool */ diff --git a/app/Services/SubmissionManager.php b/app/Services/SubmissionManager.php index a86be7924d..71dbefa053 100644 --- a/app/Services/SubmissionManager.php +++ b/app/Services/SubmissionManager.php @@ -31,10 +31,10 @@ class SubmissionManager extends Service { /** * Creates a new submission. * - * @param array $data - * @param \App\Models\User\User $user - * @param bool $isClaim - * @param mixed $isDraft + * @param array $data + * @param User $user + * @param bool $isClaim + * @param mixed $isDraft * * @return mixed */ @@ -86,7 +86,7 @@ public function createSubmission($data, $user, $isClaim = false, $isDraft = fals 'data' => json_encode([ 'user' => Arr::only(getDataReadyAssets($userAssets), ['user_items', 'currencies']), 'rewards' => getDataReadyAssets($promptRewards), - ]), // list of rewards and addons + ] + (config('lorekeeper.settings.allow_gallery_submissions_on_prompts') ? ['gallery_submission_id' => $data['gallery_submission_id'] ?? null] : [])), ]); // Set characters that have been attached. @@ -103,11 +103,11 @@ public function createSubmission($data, $user, $isClaim = false, $isDraft = fals /** * Edits an existing submission. * - * @param array $data - * @param \App\Models\User\User $user - * @param bool $isClaim - * @param mixed $submission - * @param mixed $isSubmit + * @param array $data + * @param User $user + * @param bool $isClaim + * @param mixed $submission + * @param mixed $isSubmit * * @return mixed */ @@ -158,7 +158,7 @@ public function editSubmission($submission, $data, $user, $isClaim = false, $isS 'data' => json_encode([ 'user' => Arr::only(getDataReadyAssets($userAssets), ['user_items', 'currencies']), 'rewards' => getDataReadyAssets($promptRewards), - ]), // list of rewards and addons + ] + (config('lorekeeper.settings.allow_gallery_submissions_on_prompts') ? ['gallery_submission_id' => $data['gallery_submission_id'] ?? null] : [])), ] + ($isClaim ? [] : ['prompt_id' => $prompt->id])); return $this->commitReturn($submission); @@ -216,8 +216,9 @@ public function cancelSubmission($data, $user) { 'staff_id' => $user->id, 'status' => 'Draft', 'data' => json_encode([ - 'user' => $userAssets, - 'rewards' => getDataReadyAssets($promptRewards), + 'user' => $userAssets, + 'rewards' => getDataReadyAssets($promptRewards), + 'gallery_submission_id' => $submission->data['gallery_submission_id'] ?? null, ]), // list of rewards and addons ]); @@ -232,8 +233,9 @@ public function cancelSubmission($data, $user) { 'status' => 'Draft', 'updated_at' => Carbon::now(), 'data' => json_encode([ - 'user' => $userAssets, - 'rewards' => getDataReadyAssets($promptRewards), + 'user' => $userAssets, + 'rewards' => getDataReadyAssets($promptRewards), + 'gallery_submission_id' => $submission->data['gallery_submission_id'] ?? null, ]), // list of rewards and addons ]); } @@ -249,8 +251,8 @@ public function cancelSubmission($data, $user) { /** * Rejects a submission. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return mixed */ @@ -312,8 +314,8 @@ public function rejectSubmission($data, $user) { /** * Approves a submission. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return mixed */ @@ -481,8 +483,9 @@ public function approveSubmission($data, $user) { 'staff_id' => $user->id, 'status' => 'Approved', 'data' => json_encode([ - 'user' => $addonData, - 'rewards' => getDataReadyAssets($rewards), + 'user' => $addonData, + 'rewards' => getDataReadyAssets($rewards), + 'gallery_submission_id' => $submission->data['gallery_submission_id'] ?? null, ]), // list of rewards ]); diff --git a/app/Services/TradeManager.php b/app/Services/TradeManager.php index 1a7762f1c9..645ba7f259 100644 --- a/app/Services/TradeManager.php +++ b/app/Services/TradeManager.php @@ -25,8 +25,8 @@ class TradeManager extends Service { /** * Creates a new trade. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return \App\Models\Trade|bool */ @@ -78,8 +78,8 @@ public function createTrade($data, $user) { /** * Edits a user's side of a trade. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return \App\Models\Trade|bool */ @@ -120,8 +120,8 @@ public function editTrade($data, $user) { /** * Cancels a trade. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return \App\Models\Trade|bool */ @@ -165,8 +165,8 @@ public function cancelTrade($data, $user) { /** * Confirms the user's offer. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return \App\Models\Trade|bool */ @@ -231,8 +231,8 @@ public function confirmOffer($data, $user) { /** * Confirms the trade for a user. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return \App\Models\Trade|bool */ @@ -309,8 +309,8 @@ public function confirmTrade($data, $user) { /** * Approves a trade in the admin panel. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return \App\Models\Trade|bool */ @@ -359,8 +359,8 @@ public function approveTrade($data, $user) { /** * Rejects a trade in the admin panel. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return \App\Models\Trade|bool */ @@ -408,9 +408,9 @@ public function rejectTrade($data, $user) { /** * Handles modification of assets on the user's side of a trade. * - * @param \App\Models\Trade $trade - * @param array $data - * @param \App\Models\User\User $user + * @param Trade $trade + * @param array $data + * @param User $user * * @return array|bool */ @@ -552,7 +552,7 @@ private function handleTradeAssets($trade, $data, $user) { /** * Returns trade attachments to their owners. * - * @param \App\Models\Trade $trade + * @param Trade $trade * * @return bool */ @@ -607,8 +607,8 @@ private function returnAttachments($trade) { /** * Credits trade attachments to their new owners. * - * @param \App\Models\Trade $trade - * @param array $data + * @param Trade $trade + * @param array $data * * @return bool */ diff --git a/app/Services/UserService.php b/app/Services/UserService.php index ba1c84e5c2..34f0c32ca7 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -36,7 +36,7 @@ class UserService extends Service { * * @param array $data * - * @return \App\Models\User\User + * @return User */ public function createUser($data) { // If the rank is not given, create a user with the lowest existing rank. @@ -111,7 +111,7 @@ public function validator(array $data, $socialite = false) { * * @param array $data * - * @return \App\Models\User\User + * @return User */ public function updateUser($data) { $user = User::find($data['id']); @@ -128,8 +128,8 @@ public function updateUser($data) { /** * Updates the user's password. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return bool */ @@ -158,8 +158,8 @@ public function updatePassword($data, $user) { /** * Updates the user's email and resends a verification email. * - * @param array $data - * @param \App\Models\User\User $user + * @param array $data + * @param User $user * * @return bool */ @@ -277,8 +277,8 @@ public function disableTwoFactor($code, $user) { /** * Updates the user's avatar. * - * @param \App\Models\User\User $user - * @param mixed $avatar + * @param User $user + * @param mixed $avatar * * @return bool */ @@ -327,8 +327,8 @@ public function updateAvatar($avatar, $user) { /** * Updates a user's username. * - * @param string $username - * @param \App\Models\User\User $user + * @param string $username + * @param User $user * * @return bool */ @@ -388,9 +388,9 @@ public function updateUsername($username, $user) { /** * Bans a user. * - * @param array $data - * @param \App\Models\User\User $user - * @param \App\Models\User\User $staff + * @param array $data + * @param User $user + * @param User $staff * * @return bool */ @@ -476,8 +476,8 @@ public function ban($data, $user, $staff) { /** * Unbans a user. * - * @param \App\Models\User\User $user - * @param \App\Models\User\User $staff + * @param User $user + * @param User $staff * * @return bool */ @@ -510,9 +510,9 @@ public function unban($user, $staff) { /** * Deactivates a user. * - * @param array $data - * @param \App\Models\User\User $user - * @param \App\Models\User\User $staff + * @param array $data + * @param User $user + * @param User $staff * * @return bool */ @@ -606,8 +606,8 @@ public function deactivate($data, $user, $staff = null) { /** * Reactivates a user account. * - * @param \App\Models\User\User $user - * @param \App\Models\User\User $staff + * @param User $user + * @param User $staff * * @return bool */ diff --git a/composer.json b/composer.json index eb97151ff4..80150b404f 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,8 @@ "socialiteproviders/tumblr": "^4.1", "socialiteproviders/twitch": "^5.3", "spatie/laravel-feed": "^4.1", - "spatie/laravel-honeypot": "^4.1" + "spatie/laravel-honeypot": "^4.1", + "spatie/laravel-html": "^3.5" }, "require-dev": { "fakerphp/faker": "^1.9.1", diff --git a/composer.lock b/composer.lock index d4df20c764..b4653e1b3f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ac16e377cc2e367f3e2c2d2e9a64634a", + "content-hash": "600614d9a8d933ab7520bec6c1c22baa", "packages": [ { "name": "bacon/bacon-qr-code", @@ -4899,6 +4899,84 @@ ], "time": "2024-02-29T08:20:51+00:00" }, + { + "name": "spatie/laravel-html", + "version": "3.5.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-html.git", + "reference": "ead179a8b6802647027486049f5209bd23b610a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-html/zipball/ead179a8b6802647027486049f5209bd23b610a9", + "reference": "ead179a8b6802647027486049f5209bd23b610a9", + "shasum": "" + }, + "require": { + "illuminate/http": "^9.0|^8.0|^10.0", + "illuminate/support": "^9.0|^8.0|^10.0", + "php": "^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.3", + "orchestra/testbench": "^7.0|^6.23|^8.0", + "pestphp/pest": "^1.22" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Spatie\\Html\\HtmlServiceProvider" + ], + "aliases": { + "Html": "Spatie\\Html\\Facades\\Html" + } + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Spatie\\Html\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sebastian De Deyne", + "email": "sebastian@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + }, + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "A fluent html builder", + "homepage": "https://github.com/spatie/laravel-html", + "keywords": [ + "html", + "spatie" + ], + "support": { + "source": "https://github.com/spatie/laravel-html/tree/3.5.0" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + } + ], + "time": "2024-02-20T15:17:00+00:00" + }, { "name": "spatie/laravel-package-tools", "version": "1.16.2", diff --git a/config/fortify.php b/config/fortify.php index 85501c00d3..a1b4d80595 100644 --- a/config/fortify.php +++ b/config/fortify.php @@ -89,7 +89,7 @@ | */ - 'middleware' => ['web', \Spatie\Honeypot\ProtectAgainstSpam::class], + 'middleware' => ['web', Spatie\Honeypot\ProtectAgainstSpam::class], /* |-------------------------------------------------------------------------- diff --git a/config/honeypot.php b/config/honeypot.php index 78f31ea3ee..cfc68dc348 100644 --- a/config/honeypot.php +++ b/config/honeypot.php @@ -62,5 +62,5 @@ * rules for a request. In most cases, you shouldn't change * this value. */ - 'spam_protection' => \Spatie\Honeypot\SpamProtection::class, + 'spam_protection' => Spatie\Honeypot\SpamProtection::class, ]; diff --git a/config/lorekeeper/extensions.php b/config/lorekeeper/extensions.php index b048e0d753..3b9f38caa4 100644 --- a/config/lorekeeper/extensions.php +++ b/config/lorekeeper/extensions.php @@ -28,6 +28,12 @@ 'trait_modals' => 0, // Enables modals when you click on a trait for more info instead of linking to the traits page - Moif ], + // Universal Trait Index - CHERVB + 'universal_trait_index' => [ + 'enable' => 0, + 'trait_modals' => 0, // Enables modals when you click on a trait for more info instead of linking to the traits page, like the Species Trait Index + ], + // Character Status Badges - Juni 'character_status_badges' => 0, diff --git a/config/lorekeeper/settings.php b/config/lorekeeper/settings.php index 5b8e020b40..415c956081 100644 --- a/config/lorekeeper/settings.php +++ b/config/lorekeeper/settings.php @@ -341,4 +341,14 @@ | */ 'wysiwyg_comments' => 1, + + /* + |-------------------------------------------------------------------------- + | Allow Gallery Submissions on Prompts + |-------------------------------------------------------------------------- + | + | Whether or not to allow gallery submissions on prompts. + | + */ + 'allow_gallery_submissions_on_prompts' => 1, ]; diff --git a/database/migrations/2024_02_09_104441_create_currency_conversion_tables.php b/database/migrations/2024_02_09_104441_create_currency_conversion_tables.php new file mode 100644 index 0000000000..c59a4049d5 --- /dev/null +++ b/database/migrations/2024_02_09_104441_create_currency_conversion_tables.php @@ -0,0 +1,25 @@ +integer('currency_id')->unsigned(); + $table->integer('conversion_id')->unsigned(); + $table->decimal('rate', 10, 2); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void { + Schema::dropIfExists('currency_conversions'); + } +} diff --git a/package-lock.json b/package-lock.json index 4100ffe50f..2b4b04e317 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,8 +5,8 @@ "packages": { "": { "devDependencies": { - "axios": "^1.6.2", - "blade-formatter": "^1.38.6", + "axios": "^1.6.7", + "blade-formatter": "^1.41.1", "bootstrap": "^4.6", "cross-env": "^7.0", "jquery": "^3.7", @@ -14,9 +14,9 @@ "lodash": "^4.17.21", "popper.js": "^1.16", "resolve-url-loader": "^5.0.0", - "sass": "^1.69.5", - "sass-loader": "^13.3.2", - "vue": "^3.3.13" + "sass": "^1.71.1", + "sass-loader": "^14.1.1", + "vue": "^3.4.21" } }, "node_modules/@alloc/quick-lru": { @@ -626,9 +626,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.5.tgz", - "integrity": "sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", + "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -1973,17 +1973,16 @@ "dev": true }, "node_modules/@prettier/plugin-php": { - "version": "0.19.7", - "resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.19.7.tgz", - "integrity": "sha512-QOzBs05nwuR92uak7xBHf7RCZCFXml+6Sk3cjTp2ahQlilBtupqlNjitlTXsOfPIAYwlFgLP1oSfyapS6DN00w==", + "version": "0.22.2", + "resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.22.2.tgz", + "integrity": "sha512-md0+7tNbsP0oy+wIP3KZZc6fzx1k1jtWaMjOy/gM8yU9f2BDYEi+iHOc/UNPihYvPI28zFTbjvlhH4QXQjQwNg==", "dev": true, "dependencies": { - "linguist-languages": "^7.21.0", - "mem": "^8.0.0", + "linguist-languages": "^7.27.0", "php-parser": "^3.1.5" }, "peerDependencies": { - "prettier": "^1.15.0 || ^2.0.0" + "prettier": "^3.0.0" } }, "node_modules/@shufo/tailwindcss-class-sorter": { @@ -2322,115 +2321,114 @@ } }, "node_modules/@vue/compiler-core": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.13.tgz", - "integrity": "sha512-bwi9HShGu7uaZLOErZgsH2+ojsEdsjerbf2cMXPwmvcgZfVPZ2BVZzCVnwZBxTAYd6Mzbmf6izcUNDkWnBBQ6A==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.21.tgz", + "integrity": "sha512-MjXawxZf2SbZszLPYxaFCjxfibYrzr3eYbKxwpLR9EQN+oaziSu3qKVbwBERj1IFIB8OLUewxB5m/BFzi613og==", "dev": true, "dependencies": { - "@babel/parser": "^7.23.5", - "@vue/shared": "3.3.13", + "@babel/parser": "^7.23.9", + "@vue/shared": "3.4.21", + "entities": "^4.5.0", "estree-walker": "^2.0.2", "source-map-js": "^1.0.2" } }, + "node_modules/@vue/compiler-core/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/@vue/compiler-dom": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.13.tgz", - "integrity": "sha512-EYRDpbLadGtNL0Gph+HoKiYqXLqZ0xSSpR5Dvnu/Ep7ggaCbjRDIus1MMxTS2Qm0koXED4xSlvTZaTnI8cYAsw==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.21.tgz", + "integrity": "sha512-IZC6FKowtT1sl0CR5DpXSiEB5ayw75oT2bma1BEhV7RRR1+cfwLrxc2Z8Zq/RGFzJ8w5r9QtCOvTjQgdn0IKmA==", "dev": true, "dependencies": { - "@vue/compiler-core": "3.3.13", - "@vue/shared": "3.3.13" + "@vue/compiler-core": "3.4.21", + "@vue/shared": "3.4.21" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.13.tgz", - "integrity": "sha512-DQVmHEy/EKIgggvnGRLx21hSqnr1smUS9Aq8tfxiiot8UR0/pXKHN9k78/qQ7etyQTFj5em5nruODON7dBeumw==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.21.tgz", + "integrity": "sha512-me7epoTxYlY+2CUM7hy9PCDdpMPfIwrOvAXud2Upk10g4YLv9UBW7kL798TvMeDhPthkZ0CONNrK2GoeI1ODiQ==", "dev": true, "dependencies": { - "@babel/parser": "^7.23.5", - "@vue/compiler-core": "3.3.13", - "@vue/compiler-dom": "3.3.13", - "@vue/compiler-ssr": "3.3.13", - "@vue/reactivity-transform": "3.3.13", - "@vue/shared": "3.3.13", + "@babel/parser": "^7.23.9", + "@vue/compiler-core": "3.4.21", + "@vue/compiler-dom": "3.4.21", + "@vue/compiler-ssr": "3.4.21", + "@vue/shared": "3.4.21", "estree-walker": "^2.0.2", - "magic-string": "^0.30.5", - "postcss": "^8.4.32", + "magic-string": "^0.30.7", + "postcss": "^8.4.35", "source-map-js": "^1.0.2" } }, "node_modules/@vue/compiler-ssr": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.13.tgz", - "integrity": "sha512-d/P3bCeUGmkJNS1QUZSAvoCIW4fkOKK3l2deE7zrp0ypJEy+En2AcypIkqvcFQOcw3F0zt2VfMvNsA9JmExTaw==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.21.tgz", + "integrity": "sha512-M5+9nI2lPpAsgXOGQobnIueVqc9sisBFexh5yMIMRAPYLa7+5wEJs8iqOZc1WAa9WQbx9GR2twgznU8LTIiZ4Q==", "dev": true, "dependencies": { - "@vue/compiler-dom": "3.3.13", - "@vue/shared": "3.3.13" + "@vue/compiler-dom": "3.4.21", + "@vue/shared": "3.4.21" } }, "node_modules/@vue/reactivity": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.13.tgz", - "integrity": "sha512-fjzCxceMahHhi4AxUBzQqqVhuA21RJ0COaWTbIBl1PruGW1CeY97louZzLi4smpYx+CHfFPPU/CS8NybbGvPKQ==", - "dev": true, - "dependencies": { - "@vue/shared": "3.3.13" - } - }, - "node_modules/@vue/reactivity-transform": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.13.tgz", - "integrity": "sha512-oWnydGH0bBauhXvh5KXUy61xr9gKaMbtsMHk40IK9M4gMuKPJ342tKFarY0eQ6jef8906m35q37wwA8DMZOm5Q==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.21.tgz", + "integrity": "sha512-UhenImdc0L0/4ahGCyEzc/pZNwVgcglGy9HVzJ1Bq2Mm9qXOpP8RyNTjookw/gOCUlXSEtuZ2fUg5nrHcoqJcw==", "dev": true, "dependencies": { - "@babel/parser": "^7.23.5", - "@vue/compiler-core": "3.3.13", - "@vue/shared": "3.3.13", - "estree-walker": "^2.0.2", - "magic-string": "^0.30.5" + "@vue/shared": "3.4.21" } }, "node_modules/@vue/runtime-core": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.13.tgz", - "integrity": "sha512-1TzA5TvGuh2zUwMJgdfvrBABWZ7y8kBwBhm7BXk8rvdx2SsgcGfz2ruv2GzuGZNvL1aKnK8CQMV/jFOrxNQUMA==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.21.tgz", + "integrity": "sha512-pQthsuYzE1XcGZznTKn73G0s14eCJcjaLvp3/DKeYWoFacD9glJoqlNBxt3W2c5S40t6CCcpPf+jG01N3ULyrA==", "dev": true, "dependencies": { - "@vue/reactivity": "3.3.13", - "@vue/shared": "3.3.13" + "@vue/reactivity": "3.4.21", + "@vue/shared": "3.4.21" } }, "node_modules/@vue/runtime-dom": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.13.tgz", - "integrity": "sha512-JJkpE8R/hJKXqVTgUoODwS5wqKtOsmJPEqmp90PDVGygtJ4C0PtOkcEYXwhiVEmef6xeXcIlrT3Yo5aQ4qkHhQ==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.21.tgz", + "integrity": "sha512-gvf+C9cFpevsQxbkRBS1NpU8CqxKw0ebqMvLwcGQrNpx6gqRDodqKqA+A2VZZpQ9RpK2f9yfg8VbW/EpdFUOJw==", "dev": true, "dependencies": { - "@vue/runtime-core": "3.3.13", - "@vue/shared": "3.3.13", + "@vue/runtime-core": "3.4.21", + "@vue/shared": "3.4.21", "csstype": "^3.1.3" } }, "node_modules/@vue/server-renderer": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.13.tgz", - "integrity": "sha512-vSnN+nuf6iSqTL3Qgx/9A+BT+0Zf/VJOgF5uMZrKjYPs38GMYyAU1coDyBNHauehXDaP+zl73VhwWv0vBRBHcg==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.21.tgz", + "integrity": "sha512-aV1gXyKSN6Rz+6kZ6kr5+Ll14YzmIbeuWe7ryJl5muJ4uwSwY/aStXTixx76TwkZFJLm1aAlA/HSWEJ4EyiMkg==", "dev": true, "dependencies": { - "@vue/compiler-ssr": "3.3.13", - "@vue/shared": "3.3.13" + "@vue/compiler-ssr": "3.4.21", + "@vue/shared": "3.4.21" }, "peerDependencies": { - "vue": "3.3.13" + "vue": "3.4.21" } }, "node_modules/@vue/shared": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.13.tgz", - "integrity": "sha512-/zYUwiHD8j7gKx2argXEMCUXVST6q/21DFU0sTfNX0URJroCe3b1UF6vLJ3lQDfLNIiiRl2ONp7Nh5UVWS6QnA==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.21.tgz", + "integrity": "sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==", "dev": true }, "node_modules/@webassemblyjs/ast": { @@ -2922,12 +2920,12 @@ } }, "node_modules/axios": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", - "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", + "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", "dev": true, "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.4", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -3059,12 +3057,12 @@ } }, "node_modules/blade-formatter": { - "version": "1.38.6", - "resolved": "https://registry.npmjs.org/blade-formatter/-/blade-formatter-1.38.6.tgz", - "integrity": "sha512-XwW1A4G7GPXjCG7oPKkvBp8UVb/YS/zoS8FbuuUbrnwzzmoVEe29oSqh1JpCVj9+SI2ye/qohRuXNkwHjcq/Ww==", + "version": "1.41.1", + "resolved": "https://registry.npmjs.org/blade-formatter/-/blade-formatter-1.41.1.tgz", + "integrity": "sha512-J4L0hsw+r6XSnrEpHMPDldfPeaEmhHwXacs5oFh+9FgDu2Ec7p1tLxA8QXdgcXZU0ILTMkzAtusia10oP05g3Q==", "dev": true, "dependencies": { - "@prettier/plugin-php": "^0.19.7", + "@prettier/plugin-php": "^0.22.2", "@shufo/tailwindcss-class-sorter": "3.0.1", "aigle": "^1.14.1", "ajv": "^8.9.0", @@ -3078,7 +3076,8 @@ "js-beautify": "^1.14.8", "lodash": "^4.17.19", "php-parser": "3.1.5", - "prettier": "^2.2.0", + "prettier": "^3.2.5", + "string-replace-async": "^2.0.0", "tailwindcss": "^3.1.8", "vscode-oniguruma": "1.7.0", "vscode-textmate": "^7.0.1", @@ -5175,9 +5174,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", + "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", "dev": true, "funding": [ { @@ -6463,9 +6462,9 @@ "dev": true }, "node_modules/linguist-languages": { - "version": "7.26.1", - "resolved": "https://registry.npmjs.org/linguist-languages/-/linguist-languages-7.26.1.tgz", - "integrity": "sha512-B9O5pDocOkfswmA0qKrqdfeua1TxeQ5PPWdsuo5QRXFv2N0tB3plY+DVWvSWiGkjdqKNU3KBjJYHs/jRXG0adw==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/linguist-languages/-/linguist-languages-7.27.0.tgz", + "integrity": "sha512-Wzx/22c5Jsv2ag+uKy+ITanGA5hzvBZngrNGDXLTC7ZjGM6FLCYGgomauTkxNJeP9of353OM0pWqngYA180xgw==", "dev": true }, "node_modules/loader-runner": { @@ -6549,9 +6548,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.5", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz", - "integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==", + "version": "0.30.8", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", + "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" @@ -6584,18 +6583,6 @@ "semver": "bin/semver.js" } }, - "node_modules/map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "dev": true, - "dependencies": { - "p-defer": "^1.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/md5": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", @@ -6633,22 +6620,6 @@ "node": ">= 0.6" } }, - "node_modules/mem": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/mem/-/mem-8.1.1.tgz", - "integrity": "sha512-qFCFUDs7U3b8mBDPyz5EToEKoAkgCzqquIgi9nkkR9bixxOVOre+09lbuH7+9Kn2NFpm56M3GUWVbU2hQgdACA==", - "dev": true, - "dependencies": { - "map-age-cleaner": "^0.1.3", - "mimic-fn": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/mem?sponsor=1" - } - }, "node_modules/memfs": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.5.3.tgz", @@ -6756,15 +6727,6 @@ "node": ">= 0.6" } }, - "node_modules/mimic-fn": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", - "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/mini-css-extract-plugin": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.6.2.tgz", @@ -7209,15 +7171,6 @@ "node": ">=0.10.0" } }, - "node_modules/p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha512-wB3wfAxZpk2AzOfUMJNL+d36xothRSyj8EXOa4f6GMqYDN9BJaaSISbsk+wS9abmnebVw95C2Kb5t85UmpCxuw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -7493,9 +7446,9 @@ } }, "node_modules/postcss": { - "version": "8.4.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.32.tgz", - "integrity": "sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==", + "version": "8.4.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", + "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", "dev": true, "funding": [ { @@ -8110,15 +8063,15 @@ "dev": true }, "node_modules/prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -8619,9 +8572,9 @@ "dev": true }, "node_modules/sass": { - "version": "1.69.5", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.69.5.tgz", - "integrity": "sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ==", + "version": "1.71.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.71.1.tgz", + "integrity": "sha512-wovtnV2PxzteLlfNzbgm1tFXPLoZILYAMJtvoXXkD7/+1uP41eKkIt1ypWq5/q2uT94qHjXehEYfmjKOvjL9sg==", "dev": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", @@ -8636,29 +8589,29 @@ } }, "node_modules/sass-loader": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-13.3.2.tgz", - "integrity": "sha512-CQbKl57kdEv+KDLquhC+gE3pXt74LEAzm+tzywcA0/aHZuub8wTErbjAoNI57rPUWRYRNC5WUnNl8eGJNbDdwg==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-14.1.1.tgz", + "integrity": "sha512-QX8AasDg75monlybel38BZ49JP5Z+uSKfKwF2rO7S74BywaRmGQMUBw9dtkS+ekyM/QnP+NOrRYq8ABMZ9G8jw==", "dev": true, "dependencies": { "neo-async": "^2.6.2" }, "engines": { - "node": ">= 14.15.0" + "node": ">= 18.12.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" }, "peerDependencies": { - "fibers": ">= 3.1.0", + "@rspack/core": "0.x || 1.x", "node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", "sass": "^1.3.0", "sass-embedded": "*", "webpack": "^5.0.0" }, "peerDependenciesMeta": { - "fibers": { + "@rspack/core": { "optional": true }, "node-sass": { @@ -8669,6 +8622,9 @@ }, "sass-embedded": { "optional": true + }, + "webpack": { + "optional": true } } }, @@ -9149,6 +9105,15 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/string-replace-async": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string-replace-async/-/string-replace-async-2.0.0.tgz", + "integrity": "sha512-AHMupZscUiDh07F1QziX7PLoB1DQ/pzu19vc8Xa8LwZcgnOXaw7yCgBuSYrxVEfaM2d8scc3Gtp+i+QJZV+spw==", + "dev": true, + "engines": { + "node": ">=0.12" + } + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -9790,16 +9755,16 @@ "dev": true }, "node_modules/vue": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.13.tgz", - "integrity": "sha512-LDnUpQvDgsfc0u/YgtAgTMXJlJQqjkxW1PVcOnJA5cshPleULDjHi7U45pl2VJYazSSvLH8UKcid/kzH8I0a0Q==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.21.tgz", + "integrity": "sha512-5hjyV/jLEIKD/jYl4cavMcnzKwjMKohureP8ejn3hhEjwhWIhWeuzL2kJAjzl/WyVsgPY56Sy4Z40C3lVshxXA==", "dev": true, "dependencies": { - "@vue/compiler-dom": "3.3.13", - "@vue/compiler-sfc": "3.3.13", - "@vue/runtime-dom": "3.3.13", - "@vue/server-renderer": "3.3.13", - "@vue/shared": "3.3.13" + "@vue/compiler-dom": "3.4.21", + "@vue/compiler-sfc": "3.4.21", + "@vue/runtime-dom": "3.4.21", + "@vue/server-renderer": "3.4.21", + "@vue/shared": "3.4.21" }, "peerDependencies": { "typescript": "*" @@ -10864,9 +10829,9 @@ } }, "@babel/parser": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.5.tgz", - "integrity": "sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", + "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", "dev": true }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { @@ -11797,13 +11762,12 @@ "dev": true }, "@prettier/plugin-php": { - "version": "0.19.7", - "resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.19.7.tgz", - "integrity": "sha512-QOzBs05nwuR92uak7xBHf7RCZCFXml+6Sk3cjTp2ahQlilBtupqlNjitlTXsOfPIAYwlFgLP1oSfyapS6DN00w==", + "version": "0.22.2", + "resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.22.2.tgz", + "integrity": "sha512-md0+7tNbsP0oy+wIP3KZZc6fzx1k1jtWaMjOy/gM8yU9f2BDYEi+iHOc/UNPihYvPI28zFTbjvlhH4QXQjQwNg==", "dev": true, "requires": { - "linguist-languages": "^7.21.0", - "mem": "^8.0.0", + "linguist-languages": "^7.27.0", "php-parser": "^3.1.5" } }, @@ -12137,112 +12101,107 @@ } }, "@vue/compiler-core": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.13.tgz", - "integrity": "sha512-bwi9HShGu7uaZLOErZgsH2+ojsEdsjerbf2cMXPwmvcgZfVPZ2BVZzCVnwZBxTAYd6Mzbmf6izcUNDkWnBBQ6A==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.21.tgz", + "integrity": "sha512-MjXawxZf2SbZszLPYxaFCjxfibYrzr3eYbKxwpLR9EQN+oaziSu3qKVbwBERj1IFIB8OLUewxB5m/BFzi613og==", "dev": true, "requires": { - "@babel/parser": "^7.23.5", - "@vue/shared": "3.3.13", + "@babel/parser": "^7.23.9", + "@vue/shared": "3.4.21", + "entities": "^4.5.0", "estree-walker": "^2.0.2", "source-map-js": "^1.0.2" + }, + "dependencies": { + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true + } } }, "@vue/compiler-dom": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.13.tgz", - "integrity": "sha512-EYRDpbLadGtNL0Gph+HoKiYqXLqZ0xSSpR5Dvnu/Ep7ggaCbjRDIus1MMxTS2Qm0koXED4xSlvTZaTnI8cYAsw==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.21.tgz", + "integrity": "sha512-IZC6FKowtT1sl0CR5DpXSiEB5ayw75oT2bma1BEhV7RRR1+cfwLrxc2Z8Zq/RGFzJ8w5r9QtCOvTjQgdn0IKmA==", "dev": true, "requires": { - "@vue/compiler-core": "3.3.13", - "@vue/shared": "3.3.13" + "@vue/compiler-core": "3.4.21", + "@vue/shared": "3.4.21" } }, "@vue/compiler-sfc": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.13.tgz", - "integrity": "sha512-DQVmHEy/EKIgggvnGRLx21hSqnr1smUS9Aq8tfxiiot8UR0/pXKHN9k78/qQ7etyQTFj5em5nruODON7dBeumw==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.21.tgz", + "integrity": "sha512-me7epoTxYlY+2CUM7hy9PCDdpMPfIwrOvAXud2Upk10g4YLv9UBW7kL798TvMeDhPthkZ0CONNrK2GoeI1ODiQ==", "dev": true, "requires": { - "@babel/parser": "^7.23.5", - "@vue/compiler-core": "3.3.13", - "@vue/compiler-dom": "3.3.13", - "@vue/compiler-ssr": "3.3.13", - "@vue/reactivity-transform": "3.3.13", - "@vue/shared": "3.3.13", + "@babel/parser": "^7.23.9", + "@vue/compiler-core": "3.4.21", + "@vue/compiler-dom": "3.4.21", + "@vue/compiler-ssr": "3.4.21", + "@vue/shared": "3.4.21", "estree-walker": "^2.0.2", - "magic-string": "^0.30.5", - "postcss": "^8.4.32", + "magic-string": "^0.30.7", + "postcss": "^8.4.35", "source-map-js": "^1.0.2" } }, "@vue/compiler-ssr": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.13.tgz", - "integrity": "sha512-d/P3bCeUGmkJNS1QUZSAvoCIW4fkOKK3l2deE7zrp0ypJEy+En2AcypIkqvcFQOcw3F0zt2VfMvNsA9JmExTaw==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.21.tgz", + "integrity": "sha512-M5+9nI2lPpAsgXOGQobnIueVqc9sisBFexh5yMIMRAPYLa7+5wEJs8iqOZc1WAa9WQbx9GR2twgznU8LTIiZ4Q==", "dev": true, "requires": { - "@vue/compiler-dom": "3.3.13", - "@vue/shared": "3.3.13" + "@vue/compiler-dom": "3.4.21", + "@vue/shared": "3.4.21" } }, "@vue/reactivity": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.13.tgz", - "integrity": "sha512-fjzCxceMahHhi4AxUBzQqqVhuA21RJ0COaWTbIBl1PruGW1CeY97louZzLi4smpYx+CHfFPPU/CS8NybbGvPKQ==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.21.tgz", + "integrity": "sha512-UhenImdc0L0/4ahGCyEzc/pZNwVgcglGy9HVzJ1Bq2Mm9qXOpP8RyNTjookw/gOCUlXSEtuZ2fUg5nrHcoqJcw==", "dev": true, "requires": { - "@vue/shared": "3.3.13" - } - }, - "@vue/reactivity-transform": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.13.tgz", - "integrity": "sha512-oWnydGH0bBauhXvh5KXUy61xr9gKaMbtsMHk40IK9M4gMuKPJ342tKFarY0eQ6jef8906m35q37wwA8DMZOm5Q==", - "dev": true, - "requires": { - "@babel/parser": "^7.23.5", - "@vue/compiler-core": "3.3.13", - "@vue/shared": "3.3.13", - "estree-walker": "^2.0.2", - "magic-string": "^0.30.5" + "@vue/shared": "3.4.21" } }, "@vue/runtime-core": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.13.tgz", - "integrity": "sha512-1TzA5TvGuh2zUwMJgdfvrBABWZ7y8kBwBhm7BXk8rvdx2SsgcGfz2ruv2GzuGZNvL1aKnK8CQMV/jFOrxNQUMA==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.21.tgz", + "integrity": "sha512-pQthsuYzE1XcGZznTKn73G0s14eCJcjaLvp3/DKeYWoFacD9glJoqlNBxt3W2c5S40t6CCcpPf+jG01N3ULyrA==", "dev": true, "requires": { - "@vue/reactivity": "3.3.13", - "@vue/shared": "3.3.13" + "@vue/reactivity": "3.4.21", + "@vue/shared": "3.4.21" } }, "@vue/runtime-dom": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.13.tgz", - "integrity": "sha512-JJkpE8R/hJKXqVTgUoODwS5wqKtOsmJPEqmp90PDVGygtJ4C0PtOkcEYXwhiVEmef6xeXcIlrT3Yo5aQ4qkHhQ==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.21.tgz", + "integrity": "sha512-gvf+C9cFpevsQxbkRBS1NpU8CqxKw0ebqMvLwcGQrNpx6gqRDodqKqA+A2VZZpQ9RpK2f9yfg8VbW/EpdFUOJw==", "dev": true, "requires": { - "@vue/runtime-core": "3.3.13", - "@vue/shared": "3.3.13", + "@vue/runtime-core": "3.4.21", + "@vue/shared": "3.4.21", "csstype": "^3.1.3" } }, "@vue/server-renderer": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.13.tgz", - "integrity": "sha512-vSnN+nuf6iSqTL3Qgx/9A+BT+0Zf/VJOgF5uMZrKjYPs38GMYyAU1coDyBNHauehXDaP+zl73VhwWv0vBRBHcg==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.21.tgz", + "integrity": "sha512-aV1gXyKSN6Rz+6kZ6kr5+Ll14YzmIbeuWe7ryJl5muJ4uwSwY/aStXTixx76TwkZFJLm1aAlA/HSWEJ4EyiMkg==", "dev": true, "requires": { - "@vue/compiler-ssr": "3.3.13", - "@vue/shared": "3.3.13" + "@vue/compiler-ssr": "3.4.21", + "@vue/shared": "3.4.21" } }, "@vue/shared": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.13.tgz", - "integrity": "sha512-/zYUwiHD8j7gKx2argXEMCUXVST6q/21DFU0sTfNX0URJroCe3b1UF6vLJ3lQDfLNIiiRl2ONp7Nh5UVWS6QnA==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.21.tgz", + "integrity": "sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==", "dev": true }, "@webassemblyjs/ast": { @@ -12651,12 +12610,12 @@ } }, "axios": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", - "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", + "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", "dev": true, "requires": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.4", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -12751,12 +12710,12 @@ "dev": true }, "blade-formatter": { - "version": "1.38.6", - "resolved": "https://registry.npmjs.org/blade-formatter/-/blade-formatter-1.38.6.tgz", - "integrity": "sha512-XwW1A4G7GPXjCG7oPKkvBp8UVb/YS/zoS8FbuuUbrnwzzmoVEe29oSqh1JpCVj9+SI2ye/qohRuXNkwHjcq/Ww==", + "version": "1.41.1", + "resolved": "https://registry.npmjs.org/blade-formatter/-/blade-formatter-1.41.1.tgz", + "integrity": "sha512-J4L0hsw+r6XSnrEpHMPDldfPeaEmhHwXacs5oFh+9FgDu2Ec7p1tLxA8QXdgcXZU0ILTMkzAtusia10oP05g3Q==", "dev": true, "requires": { - "@prettier/plugin-php": "^0.19.7", + "@prettier/plugin-php": "^0.22.2", "@shufo/tailwindcss-class-sorter": "3.0.1", "aigle": "^1.14.1", "ajv": "^8.9.0", @@ -12770,7 +12729,8 @@ "js-beautify": "^1.14.8", "lodash": "^4.17.19", "php-parser": "3.1.5", - "prettier": "^2.2.0", + "prettier": "^3.2.5", + "string-replace-async": "^2.0.0", "tailwindcss": "^3.1.8", "vscode-oniguruma": "1.7.0", "vscode-textmate": "^7.0.1", @@ -14391,9 +14351,9 @@ "dev": true }, "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", + "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", "dev": true }, "form-data": { @@ -15321,9 +15281,9 @@ "dev": true }, "linguist-languages": { - "version": "7.26.1", - "resolved": "https://registry.npmjs.org/linguist-languages/-/linguist-languages-7.26.1.tgz", - "integrity": "sha512-B9O5pDocOkfswmA0qKrqdfeua1TxeQ5PPWdsuo5QRXFv2N0tB3plY+DVWvSWiGkjdqKNU3KBjJYHs/jRXG0adw==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/linguist-languages/-/linguist-languages-7.27.0.tgz", + "integrity": "sha512-Wzx/22c5Jsv2ag+uKy+ITanGA5hzvBZngrNGDXLTC7ZjGM6FLCYGgomauTkxNJeP9of353OM0pWqngYA180xgw==", "dev": true }, "loader-runner": { @@ -15395,9 +15355,9 @@ } }, "magic-string": { - "version": "0.30.5", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz", - "integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==", + "version": "0.30.8", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", + "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", "dev": true, "requires": { "@jridgewell/sourcemap-codec": "^1.4.15" @@ -15420,15 +15380,6 @@ } } }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, "md5": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", @@ -15463,16 +15414,6 @@ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", "dev": true }, - "mem": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/mem/-/mem-8.1.1.tgz", - "integrity": "sha512-qFCFUDs7U3b8mBDPyz5EToEKoAkgCzqquIgi9nkkR9bixxOVOre+09lbuH7+9Kn2NFpm56M3GUWVbU2hQgdACA==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.3", - "mimic-fn": "^3.1.0" - } - }, "memfs": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.5.3.tgz", @@ -15555,12 +15496,6 @@ "mime-db": "1.52.0" } }, - "mimic-fn": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", - "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", - "dev": true - }, "mini-css-extract-plugin": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.6.2.tgz", @@ -15901,12 +15836,6 @@ "integrity": "sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==", "dev": true }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha512-wB3wfAxZpk2AzOfUMJNL+d36xothRSyj8EXOa4f6GMqYDN9BJaaSISbsk+wS9abmnebVw95C2Kb5t85UmpCxuw==", - "dev": true - }, "p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -16114,9 +16043,9 @@ "dev": true }, "postcss": { - "version": "8.4.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.32.tgz", - "integrity": "sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==", + "version": "8.4.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", + "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", "dev": true, "requires": { "nanoid": "^3.3.7", @@ -16478,9 +16407,9 @@ "dev": true }, "prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true }, "pretty-time": { @@ -16866,9 +16795,9 @@ "dev": true }, "sass": { - "version": "1.69.5", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.69.5.tgz", - "integrity": "sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ==", + "version": "1.71.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.71.1.tgz", + "integrity": "sha512-wovtnV2PxzteLlfNzbgm1tFXPLoZILYAMJtvoXXkD7/+1uP41eKkIt1ypWq5/q2uT94qHjXehEYfmjKOvjL9sg==", "dev": true, "requires": { "chokidar": ">=3.0.0 <4.0.0", @@ -16877,9 +16806,9 @@ } }, "sass-loader": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-13.3.2.tgz", - "integrity": "sha512-CQbKl57kdEv+KDLquhC+gE3pXt74LEAzm+tzywcA0/aHZuub8wTErbjAoNI57rPUWRYRNC5WUnNl8eGJNbDdwg==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-14.1.1.tgz", + "integrity": "sha512-QX8AasDg75monlybel38BZ49JP5Z+uSKfKwF2rO7S74BywaRmGQMUBw9dtkS+ekyM/QnP+NOrRYq8ABMZ9G8jw==", "dev": true, "requires": { "neo-async": "^2.6.2" @@ -17304,6 +17233,12 @@ "safe-buffer": "~5.1.0" } }, + "string-replace-async": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string-replace-async/-/string-replace-async-2.0.0.tgz", + "integrity": "sha512-AHMupZscUiDh07F1QziX7PLoB1DQ/pzu19vc8Xa8LwZcgnOXaw7yCgBuSYrxVEfaM2d8scc3Gtp+i+QJZV+spw==", + "dev": true + }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -17775,16 +17710,16 @@ "dev": true }, "vue": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.13.tgz", - "integrity": "sha512-LDnUpQvDgsfc0u/YgtAgTMXJlJQqjkxW1PVcOnJA5cshPleULDjHi7U45pl2VJYazSSvLH8UKcid/kzH8I0a0Q==", + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.21.tgz", + "integrity": "sha512-5hjyV/jLEIKD/jYl4cavMcnzKwjMKohureP8ejn3hhEjwhWIhWeuzL2kJAjzl/WyVsgPY56Sy4Z40C3lVshxXA==", "dev": true, "requires": { - "@vue/compiler-dom": "3.3.13", - "@vue/compiler-sfc": "3.3.13", - "@vue/runtime-dom": "3.3.13", - "@vue/server-renderer": "3.3.13", - "@vue/shared": "3.3.13" + "@vue/compiler-dom": "3.4.21", + "@vue/compiler-sfc": "3.4.21", + "@vue/runtime-dom": "3.4.21", + "@vue/server-renderer": "3.4.21", + "@vue/shared": "3.4.21" } }, "vue-style-loader": { diff --git a/package.json b/package.json index 7ef022e02f..60d8dad720 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "format": "./node_modules/.bin/blade-formatter --progress --write '**/*.blade.php'" }, "devDependencies": { - "axios": "^1.6.2", - "blade-formatter": "^1.38.6", + "axios": "^1.6.7", + "blade-formatter": "^1.41.1", "bootstrap": "^4.6", "cross-env": "^7.0", "jquery": "^3.7", @@ -20,8 +20,8 @@ "lodash": "^4.17.21", "popper.js": "^1.16", "resolve-url-loader": "^5.0.0", - "sass": "^1.69.5", - "sass-loader": "^13.3.2", - "vue": "^3.3.13" + "sass": "^1.71.1", + "sass-loader": "^14.1.1", + "vue": "^3.4.21" } } diff --git a/resources/views/admin/currencies/create_edit_currency.blade.php b/resources/views/admin/currencies/create_edit_currency.blade.php index 26b88dec23..c367d4d63a 100644 --- a/resources/views/admin/currencies/create_edit_currency.blade.php +++ b/resources/views/admin/currencies/create_edit_currency.blade.php @@ -110,12 +110,53 @@ + @if ($currency->id && $currency->is_user_owned) +

Conversion Rates

+

+ Choose whether this currency should be able to be converted to other currencies. If so, you can set the conversion rates here. +
+ Conversion rates are unidirectional. If you want to allow a currency to be converted both ways, you will need to create conversion on both currencies. +
+ Rates should be in decimal form. For example, 1 USD = 0.75 EUR, so the rate would be 0.75. + Conversions will only allow whole number conversions, e.g. requiring a user to convert 3 USD to 4 EUR. +
+ Conversions are only possible on user owned currencies. +

+
+
+ Add Conversion +
+
+ @foreach ($currency->conversions as $conversion) +
+ {!! Form::select('conversion_id[]', $currencies, $conversion->conversion_id, ['class' => 'form-control mr-2 conversion-select original', 'placeholder' => 'Select Currency']) !!} + {!! Form::text('rate[]', $conversion->rate, ['class' => 'form-control mr-2', 'placeholder' => 'Conversion Rate']) !!} +
+ {{ $conversion->ratio() }} +
+ × +
+ @endforeach +
+
+ @endif +
{!! Form::submit($currency->id ? 'Edit' : 'Create', ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!} + @if ($currency->id && $currency->is_user_owned) +
+ {!! Form::select('conversion_id[]', $currencies, null, ['class' => 'form-control mr-2 conversion-select', 'placeholder' => 'Select Currency']) !!} + {!! Form::text('rate[]', null, ['class' => 'form-control mr-2 conversion-rate', 'placeholder' => 'Conversion Rate']) !!} +
+
+ × +
+ @endif + @if ($currency->id)

Previews

@@ -168,12 +209,61 @@ function updateOptions() { else $characterOptions.addClass('hide'); } - - $('.delete-currency-button').on('click', function(e) { e.preventDefault(); loadModal("{{ url('admin/data/currencies/delete') }}/{{ $currency->id }}", 'Delete Currency'); }); + + /////////////////////// Conversion Rates /////////////////////// + $('.original.currency-select').selectize(); + + $('#add-conversion').on('click', function(e) { + e.preventDefault(); + addConversionRow(); + }); + $('.remove-conversion').on('click', function(e) { + e.preventDefault(); + removeConversionRow($(this)); + }) + + function addConversionRow() { + var $clone = $('.conversion-row').clone(); + $('#conversionList').append($clone); + $clone.removeClass('hide conversion-row'); + $clone.addClass('d-flex'); + $clone.find('.remove-conversion').on('click', function(e) { + e.preventDefault(); + removeConversionRow($(this)); + }) + $clone.find('.conversion-rate').on('input', function() { + var $row = $(this).parent(); + var rate = parseFloat($(this).val()); + + if (isNaN(rate) || rate <= 0) { + return; + } + + function gcd(a, b) { + if (b === 0) return a; + return gcd(b, a % b); + } + + // Convert rate to a ratio + var numerator = rate * 100; // Adjust to avoid floating point issues + var denominator = 100; + var divisor = gcd(numerator, denominator); + + numerator = numerator / divisor; + denominator = denominator / divisor; + + $row.find('.w-25').text(numerator + ' : ' + denominator); + }); + $clone.find('.conversion-select').selectize(); + } + + function removeConversionRow($trigger) { + $trigger.parent().remove(); + } }); @endsection diff --git a/resources/views/admin/features/features.blade.php b/resources/views/admin/features/features.blade.php index a3db2168bf..90464695d8 100644 --- a/resources/views/admin/features/features.blade.php +++ b/resources/views/admin/features/features.blade.php @@ -17,24 +17,46 @@
- {!! Form::open(['method' => 'GET', 'class' => 'form-inline justify-content-end']) !!} -
- {!! Form::text('name', Request::get('name'), ['class' => 'form-control', 'placeholder' => 'Name']) !!} -
-
- {!! Form::select('species_id', $specieses, Request::get('species_id'), ['class' => 'form-control']) !!} -
-
- {!! Form::select('subtype_id', $subtypes, Request::get('subtype_id'), ['class' => 'form-control']) !!} -
-
- {!! Form::select('rarity_id', $rarities, Request::get('rarity_id'), ['class' => 'form-control']) !!} -
-
- {!! Form::select('feature_category_id', $categories, Request::get('feature_category_id'), ['class' => 'form-control']) !!} + {!! Form::open(['method' => 'GET', 'class' => '']) !!} +
+
+ {!! Form::text('name', Request::get('name'), ['class' => 'form-control', 'placeholder' => 'Name']) !!} +
+
+ {!! Form::select('species_id', $specieses, Request::get('species_id'), ['class' => 'form-control']) !!} +
+
+ {!! Form::select('subtype_id', $subtypes, Request::get('subtype_id'), ['class' => 'form-control']) !!} +
+
+ {!! Form::select('rarity_id', $rarities, Request::get('rarity_id'), ['class' => 'form-control']) !!} +
+
+ {!! Form::select('feature_category_id', $categories, Request::get('feature_category_id'), ['class' => 'form-control']) !!} +
-
- {!! Form::submit('Search', ['class' => 'btn btn-primary']) !!} +
+
+ {!! Form::select( + 'sort', + [ + 'alpha' => 'Sort Alphabetically (A-Z)', + 'alpha-reverse' => 'Sort Alphabetically (Z-A)', + 'category' => 'Sort by Category', + 'rarity-reverse' => 'Sort by Rarity (Common to Rare)', + 'rarity' => 'Sort by Rarity (Rare to Common)', + 'species' => 'Sort by Species', + 'subtypes' => 'Sort by Subtype', + 'newest' => 'Newest First', + 'oldest' => 'Oldest First', + ], + Request::get('sort') ?: 'oldest', + ['class' => 'form-control'], + ) !!} +
+
+ {!! Form::submit('Search', ['class' => 'btn btn-primary']) !!} +
{!! Form::close() !!}
diff --git a/resources/views/admin/reports/report.blade.php b/resources/views/admin/reports/report.blade.php index bd90945452..b4e4c3ff98 100644 --- a/resources/views/admin/reports/report.blade.php +++ b/resources/views/admin/reports/report.blade.php @@ -75,7 +75,7 @@ @endif @if (($report->status == 'Assigned' && $report->user_id == Auth::user()->id) || Auth::user()->hasPower('manage_reports')) - @comments([ 'type' => 'Staff-User', 'model' => $report, 'perPage' => 5 ]) + @comments(['type' => 'Staff-User', 'model' => $report, 'perPage' => 5]) @endif {!! Form::open(['url' => url()->current(), 'id' => 'reportForm']) !!} @@ -135,7 +135,7 @@ @if ($report->status !== 'Closed') @parent - @section('scripts') + @section('scripts') - @endsection + @endsection @endif diff --git a/resources/views/admin/sales/create_edit_sales.blade.php b/resources/views/admin/sales/create_edit_sales.blade.php index 51158a0395..46f5343d9c 100644 --- a/resources/views/admin/sales/create_edit_sales.blade.php +++ b/resources/views/admin/sales/create_edit_sales.blade.php @@ -74,8 +74,7 @@
@if ($sales->id) - @if (count( - $sales->characters()->whereRelation('character', 'deleted_at', null)->get()) != count($sales->characters)) + @if (count($sales->characters()->whereRelation('character', 'deleted_at', null)->get()) != count($sales->characters))
Warning! Some characters have been deleted since they were added to this post. Editing this post will remove those characters permanently from the post.
diff --git a/resources/views/admin/submissions/submission.blade.php b/resources/views/admin/submissions/submission.blade.php index aebb08e64b..60f481129e 100644 --- a/resources/views/admin/submissions/submission.blade.php +++ b/resources/views/admin/submissions/submission.blade.php @@ -47,6 +47,14 @@
+ @if (config('lorekeeper.settings.allow_gallery_submissions_on_prompts') && $submission->data['gallery_submission_id']) +
+
+
Gallery Submission
+
+ +
+ @endif
Submitted
@@ -83,8 +91,7 @@

Characters

- @if (count( - $submission->characters()->whereRelation('character', 'deleted_at', null)->get()) != count($submission->characters()->get())) + @if (count($submission->characters()->whereRelation('character', 'deleted_at', null)->get()) != count($submission->characters()->get()))
Some characters have been deleted since this submission was created.
diff --git a/resources/views/admin/users/_create_edit_rank.blade.php b/resources/views/admin/users/_create_edit_rank.blade.php index 4572536557..be1ace6ff0 100644 --- a/resources/views/admin/users/_create_edit_rank.blade.php +++ b/resources/views/admin/users/_create_edit_rank.blade.php @@ -40,8 +40,8 @@ @foreach ($powers as $key => $power)
- {!! Form::checkbox('powers['.$key.']', $key, $rankPowers ? isset($rankPowers[$key]) : false, ['class' => 'form-check-input', 'id' => 'powers['.$key.']']) !!} - {!! Form::label('powers['.$key.']', $power['name'], ['class' => 'form-check-label']) !!} + {!! Form::checkbox('powers[' . $key . ']', $key, $rankPowers ? isset($rankPowers[$key]) : false, ['class' => 'form-check-input', 'id' => 'powers[' . $key . ']']) !!} + {!! Form::label('powers[' . $key . ']', $power['name'], ['class' => 'form-check-label']) !!} {!! add_help($power['description']) !!}
diff --git a/resources/views/admin/users/index.blade.php b/resources/views/admin/users/index.blade.php index bd83941ad1..9190cfcf02 100644 --- a/resources/views/admin/users/index.blade.php +++ b/resources/views/admin/users/index.blade.php @@ -83,5 +83,4 @@ {!! $users->render() !!}
{{ $count }} user{{ $count == 1 ? '' : 's' }} found.
- @endsection diff --git a/resources/views/admin/users/user_ban.blade.php b/resources/views/admin/users/user_ban.blade.php index 174c2adfa9..a39bb15851 100644 --- a/resources/views/admin/users/user_ban.blade.php +++ b/resources/views/admin/users/user_ban.blade.php @@ -43,7 +43,6 @@ Unban
@endif - @endsection @section('scripts') diff --git a/resources/views/admin/users/user_deactivate.blade.php b/resources/views/admin/users/user_deactivate.blade.php index 057f4bde9a..9488edb6a0 100644 --- a/resources/views/admin/users/user_deactivate.blade.php +++ b/resources/views/admin/users/user_deactivate.blade.php @@ -43,7 +43,6 @@ Reactivate
@endif - @endsection @section('scripts') diff --git a/resources/views/admin/users/user_update_log.blade.php b/resources/views/admin/users/user_update_log.blade.php index d83b57596a..352b0eee9f 100644 --- a/resources/views/admin/users/user_update_log.blade.php +++ b/resources/views/admin/users/user_update_log.blade.php @@ -56,5 +56,4 @@ {!! $logs->render() !!} - @endsection diff --git a/resources/views/character/_image_info.blade.php b/resources/views/character/_image_info.blade.php index b48379c660..a6361da3f8 100644 --- a/resources/views/character/_image_info.blade.php +++ b/resources/views/character/_image_info.blade.php @@ -66,10 +66,7 @@ @if (config('lorekeeper.extensions.traits_by_category'))
@php - $traitgroup = $image - ->features() - ->get() - ->groupBy('feature_category_id'); + $traitgroup = $image->features()->get()->groupBy('feature_category_id'); @endphp @if ($image->features()->count()) @foreach ($traitgroup as $key => $group) @@ -93,10 +90,7 @@
@else
- features() - ->with('feature.category') - ->get(); ?> + features()->with('feature.category')->get(); ?> @if ($features->count()) @foreach ($features as $feature)
diff --git a/resources/views/character/inventory.blade.php b/resources/views/character/inventory.blade.php index 976c75eae7..6fd462e4e4 100644 --- a/resources/views/character/inventory.blade.php +++ b/resources/views/character/inventory.blade.php @@ -46,10 +46,7 @@ @foreach ($chunk as $itemId => $stack) first()->category->can_name; - $stackName = $stack - ->first() - ->pivot->pluck('stack_name', 'id') - ->toArray()[$stack->first()->pivot->id]; + $stackName = $stack->first()->pivot->pluck('stack_name', 'id')->toArray()[$stack->first()->pivot->id]; $stackNameClean = htmlentities($stackName); ?>
Delete {{-- Likes Section --}} {!! Form::open(['url' => 'comments/' . $comment->id . '/like/1', 'class' => 'd-inline-block']) !!} diff --git a/resources/views/comments/_comment.blade.php b/resources/views/comments/_comment.blade.php index 22a86537c6..c5b88d4aa3 100644 --- a/resources/views/comments/_comment.blade.php +++ b/resources/views/comments/_comment.blade.php @@ -30,7 +30,7 @@ {{-- Comment --}} + @if (config('lorekeeper.settings.allow_gallery_submissions_on_prompts') && $submission->data['gallery_submission_id']) +
+
+
Gallery Submission
+
+ +
+ @endif
Submitted
@@ -98,8 +106,7 @@
Characters
- @if (count( - $submission->characters()->whereRelation('character', 'deleted_at', null)->get()) != count($submission->characters()->get())) + @if (count($submission->characters()->whereRelation('character', 'deleted_at', null)->get()) != count($submission->characters()->get()))
Some characters have been deleted since this submission was created.
diff --git a/resources/views/home/_submission_form.blade.php b/resources/views/home/_submission_form.blade.php index 6dc8f9c215..882eb88af2 100644 --- a/resources/views/home/_submission_form.blade.php +++ b/resources/views/home/_submission_form.blade.php @@ -24,14 +24,34 @@
@endif -
- {!! Form::label('url', $isClaim ? 'URL (Optional)' : 'Submission URL (Optional)') !!} - @if ($isClaim) - {!! add_help('Enter a URL relevant to your claim (for example, a comment proving you may make this claim).') !!} - @else - {!! add_help('Enter the URL of your submission (whether uploaded to dA or some other hosting service).') !!} +
+ + @if (config('lorekeeper.settings.allow_gallery_submissions_on_prompts') && !$isClaim) +
+
+ {!! Form::label('gallery_submission_id', 'Gallery URL (Optional)') !!} + {!! add_help('Select the gallery submission this prompt is for.') !!} + {!! Form::select('gallery_submission_id', $userGallerySubmissions, isset($submission->data['gallery_submission_id']) ? $submission->data['gallery_submission_id'] : old('gallery_submission_id') ?? Request::get('gallery_submission_id'), [ + 'class' => 'form-control selectize', + 'id' => 'gallery_submission_id', + 'placeholder' => 'Select Your Gallery Submission', + ]) !!} +
+
@endif - {!! Form::text('url', isset($submission->url) ? $submission->url : old('url') ?? Request::get('url'), ['class' => 'form-control', 'required']) !!}
diff --git a/resources/views/home/bank.blade.php b/resources/views/home/bank.blade.php index 32171424b0..ab30cb3801 100644 --- a/resources/views/home/bank.blade.php +++ b/resources/views/home/bank.blade.php @@ -42,6 +42,30 @@ View logs...
+ @if (count($convertOptions)) +

Convert Currency

+

Converting currency is a way to exchange one currency for another. The conversion rates are set by the site administrators and may change over time.

+ {!! Form::open(['url' => 'bank/convert']) !!} +
+
+
+ {!! Form::label('currency_id', 'Currency to Convert:') !!} + {!! Form::select('currency_id', $convertOptions, null, ['class' => 'form-control', 'placeholder' => 'Select Currency', 'id' => 'convert-currency']) !!} +
+
+
+
+
+ +
+ {!! Form::submit('Convert', ['class' => 'btn btn-primary']) !!} +
+ + {!! Form::close() !!} + +
+ @endif +

Transfer Currency

If you are transferring currency as part of a trade for on-site resources (items, currency, characters), using the trade system is recommended instead to protect yourself from being scammed.

{!! Form::open(['url' => 'bank/transfer']) !!} @@ -66,3 +90,21 @@
{!! Form::close() !!} @endsection +@section('scripts') + +@endsection diff --git a/resources/views/home/create_submission.blade.php b/resources/views/home/create_submission.blade.php index cf66896354..f51adeeeeb 100644 --- a/resources/views/home/create_submission.blade.php +++ b/resources/views/home/create_submission.blade.php @@ -24,7 +24,7 @@ The {{ $isClaim ? 'claim' : 'submission' }} queue is currently closed. You cannot make a new {{ $isClaim ? 'claim' : 'submission' }} at this time.
@else - @include('home._submission_form', ['submission' => $submission]) + @include('home._submission_form', ['submission' => $submission, 'userGallerySubmissions' => $userGallerySubmissions])