title: (1/1) ErrorException Undefined offset: 1
body: <p>I was trying to update my userprofile with the following controller but the problem is if i update only profile picture it shows the above error..But if i update every value it update successfully. How do i update the userProfile without updating every value :</p>
  
  <pre><code>public function updateUser(Request $request)
  {
      $this-&gt;validate($request, [
          'profile_picture' =&gt; 'dimensions:width=400,height=400',
          'cover_picture' =&gt; 'dimensions:width=800,height=400',
          'avatar' =&gt; 'dimensions:width=80,height=80',            
          ]);
  
  if (\Auth::check())
  {
      $user= User::find(\Auth::id());
  }
  
  $files= [];
  if($request-&gt;file('profile_picture'))   $files[] = $request-&gt;file('profile_picture');
  if($request-&gt;file('cover_picture'))   $files[] = $request-&gt;file('cover_picture');
  if($request-&gt;file('avatar'))   $files[] = $request-&gt;file('avatar');
  
  foreach($files as $file)
      {
          if(!empty($file))
          {
              $filename = time().str_random(20). '.' . $file-&gt;getClientOriginalExtension();
              $file-&gt;move('users/',$filename);      
              $filenames[]=$filename;
          }
      }
  
  $user-&gt;profile_picture = $filenames[0];
  $user-&gt;cover_picture = $filenames[1];
  $user-&gt;avatar = $filenames[2];
  
  $user-&gt;save();
  return redirect::back()-&gt;with('Warning',"Profile Updated Successfully");
  
  }
  </code></pre>