title: Laravel 5.2 geting Trying to get property of non-object
body: <p>2 and I am getting some strange problem I am using model inject in blade for example when I am using this code:</p>
  
  <pre><code> &lt;?php  $b = $model1-&gt;where('id', '=', $product-&gt;user_id)-&gt;first(); ?&gt;
  
    {{$b-&gt;first_name}}
  </code></pre>
  
  <p>I am getting what I want as a result but when I do the same thing wiht this code:</p>
  
  <pre><code> &lt;?php  $b1 = $model2-&gt;select('name','number')-&gt;where('device_id',  '=', $product-&gt;imception_id)-&gt;distinct()-&gt;first(); ?&gt;
    {{$b1}}
  </code></pre>
  
  <p>This gives me :</p>
  
  <pre><code> {"name":"jan","number":"447515485475"}
  </code></pre>
  
  <p>But when I am doing this :</p>
  
  <pre><code> {{$b1-&gt;name}}
  </code></pre>
  
  <p>I am getting Trying to get property of non-object  I don't know how this will work what do I need to do please answer thanks in advance.</p>