Hi, was hoping that someone here could help me resolve this error:
production.ERROR: Call to undefined function App\Services\addAsset() {“userId”:3,“exception”:"[object] (Error(code: 0): Call to undefined function App\Services\addAsset() at /www/app/Services/CharacterManager.php:2480.
The code portion in question looks like this:
$userAssets = createAssetsArray();
$characterAssets = createAssetsArray(true);
if(isset($data['stack_id'])) {
foreach($data['stack_id'] as $stackId) {
$stack = UserItem::with('item')->find($stackId);
if(!$stack || $stack->user_id != $request->user_id) throw new \Exception("Invalid item selected.");
if(!isset($data['stack_quantity'][$stackId])) throw new \Exception("Invalid quantity selected.");
$stack->update_count += $data['stack_quantity'][$stackId];
$stack->save();
addAsset($userAssets, $stack, $data['stack_quantity'][$stackId]);
}
}
The line that’s erroring is specifically the “addAsset($userAssets, $stack, $data[‘stack_quantity’][$stackId]);” part. As I’m pretty new to coding php, unfortunately I’ve not been able to understand what’s going on here, and resolving this issue on my own has proven to be an impossibility. If anyone could please help walk me through how to fix this, that would be greatly appreciated. If more information is needed, I’d be happy to provide that too. Thanks in advance!