title: Getting data out of array column in laravel 5.5
body: <p>I save my order data to <code>notifications</code> table as my notification <code>using laravel Notification</code> and I have problem with returning my data.</p>
  
  <p>here is my notification method: <code>App\Notifications\OrderSubmited.php</code></p>
  
  <pre><code>public function toArray($notifiable)
      {
          return [
              'order_id' =&gt; $this-&gt;order-&gt;id,
              'title' =&gt; $this-&gt;order-&gt;title,
              'buyer' =&gt; $this-&gt;order-&gt;user_id,
              'status' =&gt; $this-&gt;order-&gt;orderstatus_id,
          ];
      }
  </code></pre>
  
  <p>My method to get data:</p>
  
  <pre><code>View::composer('admin.dashboard', function ($view) {
            $notifications = DB::table('notifications')-&gt;orderby('id', 'desc')
                -&gt;latest()
                -&gt;take(5)
                -&gt;get();
            $notifs = $notifications;
            $view-&gt;with('notifs', $notifs);
          });
  </code></pre>
  
  <p>here is my blade code:</p>
  
  <pre><code>@foreach($notifs as $notif)
  
    {{dd($notif)}}
  
    @foreach($notif-&gt;data as $data)
      {{$data['order_id']}} &lt;br&gt;           
    @endforeach
  
  @endforeach
  </code></pre>
  
  <p>this is my <code>{{dd($notif)}}</code> output:</p>
  
  <pre><code>{#721 ▼
    +"id": "46546547464415474884"
    +"type": "App\Notifications\OrderSubmited"
    +"notifiable_id": 2
    +"notifiable_type": "App\Order"
    +"data": "{"order_id":2,"title":"tsdfg", "user_id":"1", "orderstatus_id":"11"}"
    +"read_at": null
    +"created_at": "2018-01-18 00:00:00"
    +"updated_at": "2018-01-18 00:00:00"
  }
  </code></pre>
  
  <ul>
  <li>as you can see data i try to return are stored in <code>data</code> column.</li>
  </ul>
  
  <p>If I remove my <code>dd</code> i will get this error:</p>
  
  <blockquote>
    <p>Invalid argument supplied for foreach()</p>
  </blockquote>
  
  <p>On this line:</p>
  
  <pre><code>@foreach($notif-&gt;data as $data)
  </code></pre>
  
  <p>Any idea?</p>