Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
713f962
fix(users): get lowest existing rank when creating new user (#1385)
perappu Dec 20, 2025
15fa6bd
fix: fix showRaffles check in loot js view (#1397)
Draconizations Jan 8, 2026
3443af4
fix: check filemtime in admin site images panel (#1398)
SpeedyD Jan 11, 2026
69a820e
fix(traits): fix typo, config value reference for species-only traits…
SpeedyD Jan 12, 2026
988ed8a
chore: update from release/v3.0.0
itinerare Jan 12, 2026
5cf4c0a
chore(deps-dev): bump sass from 1.97.1 to 1.97.2 (#1403)
dependabot[bot] Jan 12, 2026
0a0f234
feat(prompts): add prompt sub-categories (#1400)
ScuffedNewt Jan 19, 2026
6a42ac5
fix(characters): clarify character edit button labels (#1404)
SpeedyD Jan 19, 2026
cff830e
feat(prompts): add prompt limits (#1389)
ScuffedNewt Jan 19, 2026
ed8d9ab
fix(shops): only check date if shop is timed in active check (#1408)
perappu Jan 21, 2026
c672491
fix(browse): verify owner/artist/designer existence in ML search (#1410)
liwoyadan Jan 24, 2026
04a3511
fix(prompts): use idUrl in prompt display names (#1414)
SpeedyD Jan 26, 2026
70e1234
feat(prompts): make prompt search consistent between public/admin ind…
SpeedyD Jan 26, 2026
3031e46
fix(loot): update reward reference (#1413)
MarskyMessier Jan 26, 2026
2436a58
chore: update from release/v3.0.0
itinerare Jan 26, 2026
78dd77d
chore(deps-dev): bump lodash from 4.17.21 to 4.17.23 (#1419)
dependabot[bot] Jan 26, 2026
e396997
chore(deps-dev): bump sass from 1.97.2 to 1.97.3 (#1421)
dependabot[bot] Jan 26, 2026
d97e529
chore(deps-dev): bump axios from 1.13.2 to 1.13.3 (#1420)
dependabot[bot] Jan 26, 2026
75089da
feat(sales): make search, sort consistent between public/admin index …
SpeedyD Jan 26, 2026
905deef
feat(news): add sort and search functions to public, admin indices (#…
SpeedyD Jan 26, 2026
ef1ca3f
fix(news): fix admin index view path (#1423)
SpeedyD Jan 27, 2026
b910c7d
fix: fix news/sales default sort value (#1422)
SpeedyD Jan 27, 2026
a2c3ccb
chore(deps-dev): bump axios from 1.13.3 to 1.13.4 (#1426)
dependabot[bot] Feb 2, 2026
adf5960
chore(deps-dev): bump sass-loader from 16.0.6 to 16.0.7 (#1428)
dependabot[bot] Feb 9, 2026
07749c8
chore(deps-dev): bump axios from 1.13.4 to 1.13.5 (#1429)
dependabot[bot] Feb 9, 2026
02c20ae
fix(nav): make dropdown ids unique (#1427)
SpeedyD Feb 14, 2026
31b02ec
chore: update from release/v3.0.0
itinerare Feb 16, 2026
810bbc4
fix(submissions): fix first drafts not being able to be submitted (#1…
ScuffedNewt Mar 1, 2026
2c4a675
fix: improve asset recipient handling (#1432)
ScuffedNewt Mar 1, 2026
ac14255
refactor(prompts): move prompt limits count arrays to attribute (#1434)
notecardPasta Mar 1, 2026
1842dc9
chore(deps-dev): bump axios from 1.13.5 to 1.13.6 (#1435)
dependabot[bot] Mar 2, 2026
dedba7c
chore(deps-dev): bump postcss from 8.5.6 to 8.5.8 (#1437)
dependabot[bot] Mar 9, 2026
6a6d3f5
feat(items): add function to grab eligible stacks for debit actions w…
ScuffedNewt Mar 9, 2026
1ab2491
feat: character criterion
perappu Mar 10, 2026
9e0aaa9
refactor: fix blade formatting
perappu Mar 10, 2026
be756af
refactor: fix PHP styling
perappu Mar 10, 2026
06faa7c
Merge remote-tracking branch 'lorekeeper/develop' into extension-pr/c…
perappu Mar 10, 2026
c6fa5d2
Merge branch 'extension-pr/criteria-develop' of https://github.com/pe…
perappu Mar 10, 2026
41bdf9c
refactor: fix PHP styling
perappu Mar 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions app/Helpers/AssetHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,12 @@ function createAssetsArray($isCharacter = false) {
*
* @param array $first
* @param array $second
* @param mixed $isCharacter
*
* @return array
*/
function mergeAssetsArrays($first, $second) {
$keys = getAssetKeys();
function mergeAssetsArrays($first, $second, $isCharacter = false) {
$keys = getAssetKeys($isCharacter);
foreach ($keys as $key) {
foreach ($second[$key] as $item) {
addAsset($first, $item['asset'], $item['quantity']);
Expand Down Expand Up @@ -210,11 +211,12 @@ function getDataReadyAssets($array, $isCharacter = false) {
* basically reversing the above function.
*
* @param array $array
* @param mixed $isCharacter
*
* @return array
*/
function parseAssetData($array) {
$assets = createAssetsArray();
function parseAssetData($array, $isCharacter = false) {
$assets = createAssetsArray($isCharacter);
foreach ($array as $key => $contents) {
$model = getAssetModelString($key);
if ($model) {
Expand Down
86 changes: 72 additions & 14 deletions app/Http/Controllers/Admin/Data/PromptController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public function getIndex() {
*/
public function getCreatePromptCategory() {
return view('admin.prompts.create_edit_prompt_category', [
'category' => new PromptCategory,
'category' => new PromptCategory,
'categories' => PromptCategory::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(),
]);
}

Expand All @@ -56,7 +57,8 @@ public function getEditPromptCategory($id) {
}

return view('admin.prompts.create_edit_prompt_category', [
'category' => $category,
'category' => $category,
'categories' => PromptCategory::where('id', '!=', $category->id)->orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(),
]);
}

Expand All @@ -71,7 +73,7 @@ public function getEditPromptCategory($id) {
public function postCreateEditPromptCategory(Request $request, PromptService $service, $id = null) {
$id ? $request->validate(PromptCategory::$updateRules) : $request->validate(PromptCategory::$createRules);
$data = $request->only([
'name', 'description', 'image', 'remove_image',
'name', 'description', 'image', 'remove_image', 'parent_id',
]);
if ($id && $service->updatePromptCategory(PromptCategory::find($id), $data, Auth::user())) {
flash('Category updated successfully.')->success();
Expand Down Expand Up @@ -149,23 +151,76 @@ public function postSortPromptCategory(Request $request, PromptService $service)
**********************************************************************************************/

/**
* Shows the prompt category index.
* Shows the prompt index.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function getPromptIndex(Request $request) {
$query = Prompt::query();
$data = $request->only(['prompt_category_id', 'name']);
$query = Prompt::query()->with('category');
$data = $request->only(['prompt_category_id', 'name', 'sort', 'open_prompts']);
if (isset($data['prompt_category_id']) && $data['prompt_category_id'] != 'none') {
$query->where('prompt_category_id', $data['prompt_category_id']);
if ($data['prompt_category_id'] == 'withoutOption') {
$query->whereNull('prompt_category_id');
} else {
$query->where('prompt_category_id', $data['prompt_category_id']);
}
}
if (isset($data['name'])) {
$query->where('name', 'LIKE', '%'.$data['name'].'%');
}

if (isset($data['open_prompts'])) {
switch ($data['open_prompts']) {
case 'open':
$query->open(true);
break;
case 'closed':
$query->open(false);
break;
case 'any':
default:
// Don't filter
break;
}
}

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 'newest':
$query->sortNewest();
break;
case 'oldest':
$query->sortNewest(true);
break;
case 'start':
$query->sortStart();
break;
case 'start-reverse':
$query->sortStart(true);
break;
case 'end':
$query->sortEnd();
break;
case 'end-reverse':
$query->sortEnd(true);
break;
}
} else {
$query->sortCategory();
}

return view('admin.prompts.prompts', [
'prompts' => $query->paginate(20)->appends($request->query()),
'categories' => ['none' => 'Any Category'] + PromptCategory::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(),
'categories' => ['none' => 'Any Category'] + ['withoutOption' => 'Without Category'] + PromptCategory::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(),
]);
}

Expand All @@ -176,9 +231,10 @@ public function getPromptIndex(Request $request) {
*/
public function getCreatePrompt() {
return view('admin.prompts.create_edit_prompt', [
'prompt' => new Prompt,
'categories' => ['none' => 'No category'] + PromptCategory::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(),
'criteria' => Criterion::active()->orderBy('name')->pluck('name', 'id'),
'prompt' => new Prompt,
'categories' => ['none' => 'No category'] + PromptCategory::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(),
'limit_periods' => config('lorekeeper.extensions.limit_periods'),
'criteria' => Criterion::active()->orderBy('name')->pluck('name', 'id'),
]);
}

Expand All @@ -196,9 +252,10 @@ public function getEditPrompt($id) {
}

return view('admin.prompts.create_edit_prompt', [
'prompt' => $prompt,
'categories' => ['none' => 'No category'] + PromptCategory::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(),
'criteria' => Criterion::active()->orderBy('name')->pluck('name', 'id'),
'prompt' => $prompt,
'categories' => ['none' => 'No category'] + PromptCategory::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(),
'limit_periods' => config('lorekeeper.extensions.limit_periods'),
'criteria' => Criterion::active()->orderBy('name')->pluck('name', 'id'),
]);
}

Expand All @@ -215,6 +272,7 @@ public function postCreateEditPrompt(Request $request, PromptService $service, $
$data = $request->only([
'name', 'prompt_category_id', 'summary', 'description', 'start_at', 'end_at', 'hide_before_start', 'hide_after_end', 'is_active', 'image', 'remove_image', 'prefix', 'hide_submissions', 'staff_only',
'rewardable_type', 'rewardable_id', 'quantity', 'rewardable_recipient',
'limit', 'limit_period', 'limit_character',
'criterion_id', 'criterion', 'criterion_currency_id', 'default_criteria',
]);
if ($id && $service->updatePrompt(Prompt::find($id), $data, Auth::user())) {
Expand Down
35 changes: 33 additions & 2 deletions app/Http/Controllers/Admin/NewsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,40 @@ class NewsController extends Controller {
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function getIndex() {
public function getIndex(Request $request) {
$query = News::visible(Auth::user() ?? null);
$data = $request->only(['title', 'sort']);
if (isset($data['title'])) {
$query->where('title', 'LIKE', '%'.$data['title'].'%');
}

if (isset($data['sort'])) {
switch ($data['sort']) {
case 'alpha':
$query->sortAlphabetical();
break;
case 'alpha-reverse':
$query->sortAlphabetical(true);
break;
case 'newest':
$query->sortNewest();
break;
case 'oldest':
$query->sortNewest(true);
break;
case 'bump':
$query->sortBump();
break;
case 'bump-reverse':
$query->sortBump(true);
break;
}
} else {
$query->sortBump(true);
}

return view('admin.news.news', [
'newses' => News::orderBy('updated_at', 'DESC')->paginate(20),
'newses' => $query->paginate(20)->appends($request->query()),
]);
}

Expand Down
38 changes: 36 additions & 2 deletions app/Http/Controllers/Admin/SalesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,43 @@ class SalesController extends Controller {
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function getIndex() {
public function getIndex(Request $request) {
$query = Sales::visible(Auth::user() ?? null);
$data = $request->only(['title', 'is_open', 'sort']);
if (isset($data['is_open']) && $data['is_open'] != 'none') {
$query->where('is_open', $data['is_open']);
}
if (isset($data['title'])) {
$query->where('title', 'LIKE', '%'.$data['title'].'%');
}

if (isset($data['sort'])) {
switch ($data['sort']) {
case 'alpha':
$query->sortAlphabetical();
break;
case 'alpha-reverse':
$query->sortAlphabetical(true);
break;
case 'newest':
$query->sortNewest();
break;
case 'oldest':
$query->sortNewest(true);
break;
case 'bump':
$query->sortBump();
break;
case 'bump-reverse':
$query->sortBump(true);
break;
}
} else {
$query->sortBump(true);
}

return view('admin.sales.sales', [
'saleses' => Sales::orderBy('post_at', 'DESC')->paginate(20),
'saleses' => $query->paginate(20)->appends($request->query()),
]);
}

Expand Down
11 changes: 10 additions & 1 deletion app/Http/Controllers/Admin/SubmissionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ public function getSubmission($id) {
abort(404);
}

$prompt = $submission->prompt;

if ($prompt->limit_character) {
$limit = $prompt->limit * Character::visible()->where('is_myo_slot', 0)->where('user_id', $submission->user_id)->count();
} else {
$limit = $prompt->limit;
}

return view('admin.submissions.submission', [
'submission' => $submission,
'inventory' => $inventory,
Expand All @@ -78,7 +86,8 @@ public function getSubmission($id) {
'currencies' => Currency::where('is_user_owned', 1)->orderBy('name')->pluck('name', 'id'),
'tables' => LootTable::orderBy('name')->pluck('name', 'id'),
'raffles' => Raffle::where('rolled_at', null)->where('is_active', 1)->orderBy('name')->pluck('name', 'id'),
'count' => Submission::where('prompt_id', $submission->prompt_id)->where('status', 'Approved')->where('user_id', $submission->user_id)->count(),
'count' => $prompt->getCount($submission->user),
'limit' => $limit,
] : []));
}

Expand Down
55 changes: 54 additions & 1 deletion app/Http/Controllers/CriterionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,37 @@ public function getCriterionForm($entity, $id, $entity_id = null, $form_id = nul
]);
}

/**
* returns a character criterion's form based on steps.
*
* @param mixed|null $entity
* @param mixed $id
* @param mixed|null $entity_id
* @param mixed|null $form_id
* @param mixed $slug
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function getCharacterCriterionForm($slug, $entity, $id, $entity_id = null, $form_id = null) {
if ($entity_id && $entity) {
if ($entity === 'prompt') {
$entityCriteria = PromptCriterion::where('prompt_id', $entity_id)->where('criterion_id', $id)->first();
} elseif ($entity === 'gallery') {
$entityCriteria = GalleryCriterion::where('gallery_id', $entity_id)->where('criterion_id', $id)->first();
}
}

return view('criteria._minimum_character_requirements', [
'criterion' => Criterion::where('id', $id)->first(),
'character' => $slug,
'minRequirements' => isset($entityCriteria) ? $entityCriteria->minRequirements : null,
'title' => isset($entityCriteria) ? 'Criterion Options' : null,
'limitByMinReq' => isset($entityCriteria) ? true : null,
'id' => $form_id,
'criterion_currency' => $entityCriteria->criterion_currency_id ?? $entityCriteria->criterion->currency_id,
]);
}

/**
* returns a criterion dd based on entity.
*
Expand All @@ -62,7 +93,7 @@ public function getCriterionForm($entity, $id, $entity_id = null, $form_id = nul
*/
public function getCriterionSelector($entity, $id) {
if ($entity === 'prompt') {
$entityCriteria = PromptCriterion::where('prompt_id', $id)->pluck('criterion_id')->toArray();
$entityCriteria = PromptCriterion::where('prompt_id', $id)->get()->where('characterCriteria', '=', false)->pluck('criterion_id')->toArray();
} elseif ($entity === 'gallery') {
$entityCriteria = GalleryCriterion::where('gallery_id', $id)->pluck('criterion_id')->toArray();
}
Expand All @@ -74,6 +105,28 @@ public function getCriterionSelector($entity, $id) {
]);
}

/**
* returns a criterion dd based on entity.
*
* @param mixed $entity
* @param mixed $id
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function getCharacterCriterionSelector($entity, $id) {
if ($entity === 'prompt') {
$entityCriteria = PromptCriterion::where('prompt_id', $id)->get()->where('characterCriteria', '=', true)->pluck('criterion_id')->toArray();
} elseif ($entity === 'gallery') {
$entityCriteria = GalleryCriterion::where('gallery_id', $id)->pluck('criterion_id')->toArray();
}

$criteria = Criterion::whereIn('id', $entityCriteria)->pluck('name', 'id');

return view('criteria._criterion_character_selector', [
'criteria' => $criteria,
]);
}

/**
* returns an amount based on a criterion id and data.
*
Expand Down
Loading