lundi 2 avril 2018

ErrorException (E_ERROR) Undefined index: streetNumber

I have this decoded JSON and would like to display the data in my view but I get

ErrorException (E_ERROR) Undefined index: streetNumber

Here is a sample of the data:

array(11) {
    [0] => array(26) {
        ["privateRemarks"] => string(98)
        "Please use showing time and *** is available for any questions regarding showings at 00000" ["property"] => array(40) {
            ["roof"] => NULL["cooling"] => string(27)
            "Central Cooling,Paddle Fans" ["style"] => string(8)
            "Detached" ["area"] => NULL["bathsFull"] => int(5)["bathsHalf"] => int(1)["stories"] => NULL["fireplaces"] => NULL["flooring"] => string(13)
            "Marble Floors" ["heating"] => string(26)
            "Central Heat,Electric Heat" ["bathrooms"] => string(4)
            "6.00" ["foundation"] => NULL["laundryFeatures"] => NULL["occupantName"] => NULL["ownerName"] => NULL["lotDescription"] => string(22)
            "Less Than 1/4 Acre Lot" ["pool"] => string(17)
            "Below Ground Pool" ["subType"] => NULL["bedrooms"] => int(5)["interiorFeatures"] => string(18)
            "Second Floor Entry" ["lotSize"] => string(6)
            "55x127" ["areaSource"] => NULL["maintenanceExpense"] => NULL["additionalRooms"] => string(38)
            "Family Room,Other,Utility Room/Laundry" ["exteriorFeatures"] => string(35)
            "High Impact Doors,Exterior Lighting" ["water"] => string(15)
            "Municipal Water" ["view"] => string(25)
            "Ocean View,Pool Area View" ["lotSizeArea"] => int(55)["subdivision"] => NULL["construction"] => string(16)
            "CBS Construction" ["parking"] => array(3) {
                ["leased"] => NULL["spaces"] => NULL["description"] => string(8)
                "Driveway"
            }["lotSizeAreaUnits"] => NULL["type"] => string(3)
            "RES" ["garageSpaces"] => int(2)["bathsThreeQuarter"] => NULL["accessibility"] => NULL["acres"] => NULL["occupantType"] => string(18)
            "Call Listing Agent" ["subTypeText"] => NULL["yearBuilt"] => int(2006)
        }["mlsId"] => int(000000)["terms"] => NULL["showingInstructions"] => NULL["office"] => array(4) {
            ["contact"] => array(3) {
                ["email"] => NULL["office"] => string(12)
                "000000000" ["cell"] => NULL
            }["name"] => string(15)
            "**********" ["servingName"] => string(15)
            "**********" ["brokerid"] => string(6)
            "*****"
        }["leaseTerm"] => NULL["disclaimer"] => string(66)
        "This information is believed to be accurate, but without warranty." ["address"] => array(10) {
            ["crossStreet"] => NULL["state"] => string(2)
            "FL" ["country"] => string(13)
            "United States" ["postalCode"] => string(5)
            "33304" ["streetName"] => string(28)
            "N Fort Lauderdale Beach Blvd" ["streetNumberText"] => string(4)
            "00000" ["city"] => string(15)
            "Fort Lauderdale" ["streetNumber"] => int(0000)["full"] => string(33)
            "******* Beach Blvd" ["unit"] => NULL
        }["agreement"] => string(28)
        "Exclusive Right to Sell/Rent" ["listDate"] => NULL["agent"] => array(4) {
            ["lastName"] => string(8)
            "******" ["contact"] => array(3) {
                ["email"] => string(16)
                "***********" ["office"] => string(12)
                "******" ["cell"] => NULL
            }["firstName"] => string(6)
            "*****" ["id"] => string(7)
            "******"
        }["modified"] => string(24)
        "2018-04-01T08:27:17.903Z" ["school"] => NULL["photos"] => array(65) {
            [0] => string(168)
            "img.jpg" [1] => string(168)

        }["listPrice"] => int(00005000)["listingId"] => string(9)
        "*******" ["mls"] => array(6) {
            ["status"] => string(6)
            "Active" ["area"] => string(4)
            "3160" ["daysOnMarket"] => NULL["originatingSystemName"] => NULL["statusText"] => string(6)
            "Active" ["areaMinor"] => NULL
        }["geo"] => array(5) {
            ["county"] => string(14)
            "Broward County" ["lat"] => NULL["lng"] => NULL["marketArea"] => string(4)
            "31" ["directions"] => NULL
        }["tax"] => array(3) {
            ["taxYear"] => int(2017)["taxAnnualAmount"] => int(41)["id"] => string(12)
            "494331"
        }["coAgent"] => NULL["sales"] => NULL["leaseType"] => NULL["virtualTourUrl"] => string(56)
        "https://www.prop.com" ["remarks"] => string(65)
        "4 levels of your estate." ["association"] => array(3) {
            ["fee"] => int(0)["name"] => string(10)
            "Homeowners" ["amenities"] => NULL
        }

    }
}

Here the Controller excerpt

$properties = json_decode($file, true);
return view('properties.all-properties')->with('properties',$properties);

Here is the test in my view

@foreach($properties as $details) 
    
@endforeach

I would like to loop trough the data an build the listing info



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire