title: Undefined offset: 0 (View: path\profile.blade.php) issue in laravel
body: <p>When i click form submit button page redirects to addshortlist function. Function showing Undefined offset: 0 (View: path\profile.blade.php ) error. And below my form</p>
  <pre><code>&lt;form action=&quot;addshortlist&quot; id=&quot;addshortlist&quot; method=&quot;PUT&quot;&gt;
    {{ csrf_field() }}
   &lt;input type=&quot;hidden&quot; name=&quot;shortlistid&quot; value=&quot;{{$data[0]-&gt;id}}&quot;&gt;         
   &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;Add Shortlist&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  <p>my route function is</p>
  <pre><code>Route::post('addshortlist','UserController@addshortlist');
  </code></pre>
  <p>function be like</p>
  <pre><code>function addshortlist()
      { 
         //
      }
  </code></pre>