title: Change the name of multiple file upload in laravel
body: <p>Below is the function I have in my controller to help with the file name</p>
  
  <pre><code>public function pusher(Request $request){
  
      if($request-&gt;hasfile('doc')) {
          $files=$request-&gt;file('doc');
          foreach($files as $file){
              $name=$file-&gt;getClientOriginalName();
              $doc=new documents();
              $doc-&gt;claim_id=request('id');
              $doc-&gt;description=request('det');
              $doc-&gt;file_name=$name;
              $doc-&gt;type='received';
              $doc-&gt;cat=request('type');
              $doc-&gt;save();
              $location = 'Documents';
              $file-&gt;move($location,request('type')$name);
          }    
      }
      Alert::success('Successful', 'Document(s) Uploaded');
      return redirect()-&gt;back();
  }
  </code></pre>
  
  <p>My desired result is that I want the file to be uploaded with the following names e. if I have like 2 images uploaded, I would want the names to be doc1(1) and doc1(2)</p>