title: Upload array of files Laravel
body: <p>I want to upload an array of files,in Laravel , and I am not sure what is the path and who to store the file. Eight now the data are stored ,but in my case the path is #. In the image  below I have the data that I am sending from front (Vuejs and I am using vue-upload-component)</p>
  
  <p><a href="https://i.stack.imgur.com/oOL2M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oOL2M.png" alt="enter image description here"></a></p>
  
  <pre><code>$fileName = [];
  
  foreach($request-&gt;input('files') as $files){
         $contractFile = new ContractFile();
         $contractFile-&gt;fill([
             'contract_id'   =&gt; $contract-&gt;id,
             'name'          =&gt; $files['name'],
             'path'          =&gt; '#',
         ])-&gt;save();
  }
  </code></pre>
  
  <p><strong>ContractFile</strong></p>
  
  <pre><code>class ContractFile extends Model
  {
      protected $fillable = ['path','contract_id','name'];
  
      public function contract()
      {
          return $this-&gt;belongsTo(Contract::class);
      }
  
  }
  </code></pre>
  
  <p><strong>ContractFile db</strong></p>
  
  <pre><code>    Schema::create('contract_files', function (Blueprint $table) {
      $table-&gt;bigIncrements('id');
      $table-&gt;integer('contract_id');
      $table-&gt;string('path');
      $table-&gt;string('name');
      $table-&gt;timestamps();
  });
  </code></pre>
  
  <p><strong>filesystems.php</strong></p>
  
  <pre><code>'uploads' =&gt;[
      'driver' =&gt; 'local',
      'root' =&gt; storage_path().'file/uploads',
  ],
  </code></pre>