title: How can I display arrays one value in Laravel/PHP?
body: <p>I have created an array and I want to display the array's value <code>opens</code> and <code>closes</code> to the view. </p>
  
  <p>Shop class:</p>
  
  <pre><code>public function jsonLDFields()
  {
      return $this-&gt;hasOne(JsonLDFields::class);
  }
  </code></pre>
  
  <p>JsonLDFields class:</p>
  
  <pre><code>public function shop()
  {
      return $this-&gt;belongsTo('App\User');
  }
  </code></pre>
  
  <p>A shop has <code>jsonLDFields</code>, <code>jsonLDFields</code> has a DB column <code>value</code> for <code>store_opens</code> / <code>store_closes</code> </p>
  
  <pre><code>store_opens[store_times][monday][opens]
  
  "store_opens" =&gt; array:1 [▼
      "store_times" =&gt; array:7 [▼
        "Monday" =&gt; array:1 [▼
          "opens" =&gt; "09:00"
        ]
        "Tuesday" =&gt; array:1 [▼
          "opens" =&gt; "09:00"
        ]
        "Wednesday" =&gt; array:1 [▼
          "opens" =&gt; "09:00"
        ]
        "Thursday" =&gt; array:1 [▼
          "opens" =&gt; "09:00"
        ]
        "Friday" =&gt; array:1 [▼
          "opens" =&gt; "09:00"
        ]
        "Saturday" =&gt; array:1 [▼
          "closes" =&gt; "10:00"
        ]
        "Sunday" =&gt; array:1 [▼
          "opens" =&gt; "10:00"
        ]
      ]
    ]
  </code></pre>
  
  <p>When I try to display it like this: </p>
  
  <p><code>$shop-&gt;jsonLDFields-&gt;store_closes</code>.</p>
  
  <p>The result is all arrays values.</p>
  
  <p>When I try to display it like this: </p>
  
  <p><code>$shop-&gt;jsonLDFields-&gt;store_closes['opens']</code></p>
  
  <p>The result is null.</p>
  
  <p>When I try to display it like this:</p>
  
  <pre><code>$shop-&gt;jsonLDFields-&gt;store_opens['store_times']['Monday']['opens']
  </code></pre>
  
  <p>The result is null.</p>
  
  <p>When I do <code>dd($shop-&gt;jsonLDFields-&gt;store_opens);</code></p>
  
  <p>I get:</p>
  
  <pre><code> array:1 [▼
   "store_times" =&gt; array:7 [▼
   "Monday" =&gt; array:1 [▼
    "opens" =&gt; "09:00"
  ]
  "tuesday" =&gt; array:1 [▼
    "opens" =&gt; "09:00"
  ]
  "Wednesday" =&gt; array:1 [▼
    "opens" =&gt; "09:00"
  ]
  "Thursday" =&gt; array:1 [▼
    "opens" =&gt; "09:00"
  ]
  "Friday" =&gt; array:1 [▼
    "opens" =&gt; "09:00"
  ]
  "Saturday" =&gt; array:1 [▼
    "closes" =&gt; "10:00"
  ]
  "Sunday" =&gt; array:1 [▼
    "opens" =&gt; "10:00"
      ]
    ]
   ]
  </code></pre>
  
  <p>How could I display the <code>opens</code> and <code>closes</code> values in the view?</p>