Q:

Parsing returns an empty value

I make a parser of items from DotA 2 user inventory in the Steam service. Every time I try to parse user data, I get an empty value:
{"success":true,"items":[]}, but there are items in my Steam inventory.
My function to parse items:
public function loadMyInventory() {
    if(Auth::guest()) return ['success' => false];
    $prices = json_decode(Storage::get('prices.txt'), true);
    $response = json_decode(file_get_contents('https://steamcommunity.com/inventory/'.$this->user->steamid64.'/570/2?l=russian&count=5000'), true);
    if(time() < (Session::get('InvUPD') + 5)) {
        return [
            'success' => false,
            'msg' => 'Error, repeat in '.(Session::get('InvUPD') - time() + 5).' сек.',
            'status' => 'error'
        ];
    }
    //return $response;
    $inventory = [];

    foreach($response['assets'] as $item) {
        $find = 0;
        foreach($response['descriptions'] as $descriptions) {
            if($find == 0) {
                if(($descriptions['classid'] == $item['classid']) && ($descriptions['instanceid'] == $item['instanceid'])) {
                    $find++;
                    # If we find the price of an item, then move on.
                    if(isset($prices[$descriptions['market_hash_name']])) {
                        # Search data
                        $price = $prices[$descriptions['market_hash_name']]*$this->config->curs;
                        $class = false;
                        $text = false;

                        if($price <= $this->config->min_dep_sum) {
                            $price = 0;
                            $text = 'Cheap';
                            $class = 'minPrice';
                        }

                        if(($descriptions['tradable'] == 0) || ($descriptions['marketable'] == 0)) {
                            $price = 0;
                            $class = 'minPrice';
                                $text = 'Not tradable';
                        }
                        # Adding to Array
                        $inventory[] = [
                            'name' => $descriptions['market_name'],
                            'price' => floor($price),
                            'color' => $this->getRarity($descriptions['tags']),
                            'tradable' => $descriptions['tradable'],
                            'class' => $class,
                            'text' => $text,
                            'classid' => $item['classid'],
                            'assetid' => $item['assetid'],
                            'instanceid' => $item['instanceid']
                        ];   
                    }
                }
            }
        }
    }
    Session::put('InvUPD', (time() + 5));
    return [
        'success' => true,
        'items' => $inventory
    ];
}

But should return approximately the following value:
{"success":true,"items":[{"classid":"2274725521","instanceid":"57949762","assetid":"18235196074","market_hash_name":"Full-Bore Bonanza","price":26}]}

Where my mistake? 

A:

First of all, you are iterating on descriptions for every assets, which is assets*descriptions iteration, it's quite a lot, but you can optimize this.
let's loop once for descriptions and assign classid and instanceid as object key.
$assets = $response["assets"];
$descriptions = $response["descriptions"];

$newDescriptions=[]; 
foreach($descriptions as $d){
    $newDescriptions[$d["classid"]][$d["instanceid"]] = $d;
}

this will give as the ability to not loop over description each time, we can access the description of certain  asset directly $newDescriptions[$classid][$instanceid]]
foreach($assets as $a){
    if(isset($newDescriptions[$a["classid"]]) && isset($newDescriptions[$a["classid"]][$a["instanceid"]])){
            $assetDescription = $newDescriptions[$a["classid"]][$a["instanceid"]];
            $inventory = [];
            if(isset($prices[$assetDescription["market_hash_name"]])){
                $price = $prices[$assetDescription['market_hash_name']]["price"]*$this->config->curs;
                $class = false;
                $text = false;

                if($price <= $this->config->min_dep_sum) {
                    $price = 0;
                    $text = 'Cheap';
                    $class = 'minPrice';
                }

                if(($assetDescription['tradable'] == 0) || ($assetDescription['marketable'] == 0)) {
                    $price = 0;
                    $class = 'minPrice';
                    $text = 'Not tradable';
                }

                $inventory["priceFound"][] = [
                'name' => $assetDescription['market_name'],
                'price' => floor($price),
                'color' => $this->getRarity($assetDescription['tags']),
                'tradable' => $assetDescription['tradable'],
                'class' => $class,
                'text' => $text,
                'classid' => $a['classid'],
                'assetid' => $a['assetid'],
                'instanceid' => $a['instanceid']
                ];  
            }else{
                $inventory["priceNotFound"][] = $assetDescription["market_hash_name"];
            }
    }
}

About your mistake:
are you Sure your "prices.txt" contains market_hash_name?
I don't see any other issue yet, operationg on the data you have provided in comment, I got print of variable $assetDescription. Please doublecheck variable $prices.

