Skip to content

Commit

Permalink
update for fewer reads
Browse files Browse the repository at this point in the history
  • Loading branch information
zmsMarc committed May 24, 2024
1 parent 1d8f1ed commit 6a52cf6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Http/Controllers/Character/SheetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@ class SheetController extends Controller
public function show(CharacterInfo $character)
{
//create key/value pairs for implant IDs and texts
$jumpclone_implants = [];
foreach ($character->jump_clones as $jump_clone) {
foreach($jump_clone->implants as $implant_id) {
$jumpclone_implants[$implant_id] = InvType::find($implant_id)->typeName;
}
}
$jumpclone_implant_ids = collect($character->jump_clones)
->pluck('implants')
->flatten()
->unique();

$jumpclone_implants = InvType::whereIn('typeID', $jumpclone_implant_ids)
->get()
->pluck('typeName', 'typeID')
->toArray();

return view('web::character.sheet', compact('character', 'jumpclone_implants'));
}
Expand Down

0 comments on commit 6a52cf6

Please sign in to comment.