**i try to build form to create invoice and then generate it pdf**

**My Db structure**

tables:

-- invoices **contain** date | invoice\_num | client\_id

-- articles **contain** name | description | price

-- article\_invoice **contain** invoice\_id | article\_id | qte\*(Quantity)\*

**Using a BelongsToMany Relation to save article\_id & invoice\_id**

My Invoice Controller

```
  public function store(Request $request){
      $qte = $request['qte'];

      $request = $request['fields'];

      $facture = Facture::create(['date'=>'2018-08-22', 'facture_num'=>'4','client_id'=>'6']);

      $facture->article()->sync($request);

      $facture->article()->update($qte);

  }

```

**my view**

```
<div class="controls">
    {!! Form::open(array('route' =>'factures.store' ,'method'=>'post','enctype'=>'multipart/form-data')) !!}
    <div class="entry input-group col-md-6">
        <select class="form-control" name="fields[]" type="text" placeholder="Type something">
            @foreach($articles as $article)
                <option value="{{$article->id}}">{{ $article->designation}}</option>
            @endforeach
        </select>
        <input type="number" name="qte[]">

        <span class="input-group-btn">
            <button class="btn btn-success btn-add" type="button">
                <span class="glyphicon glyphicon-plus"></span>
            </button>
        </span>
    </div>
    <br>
</div>
</div>

<button type="submit" class="btn btn-primary btn-sm">
        <i class="fa fa-dot-circle-o"></i> Submit
</button>
{!! Form::close() !!}

```

\*\*after syncronize article\_invoice i want to save the qte any help please ? \*\*