title: save info of contact form in database in laravel
body: <blockquote>
    <p>I'm working with laravel 5.4.</p>
  </blockquote>
  
  <p>I try to make sell part (store) in my website and for items that I need to sell I don't want to use regular way!</p>
  
  <p>what that means? usually in commerce websites when you set to order a product you will go to some place named cart and there has all calculations, you pay and it's done.</p>
  
  <p>for me I try to get info with contact form, each item has a form inside and user fulfill the form then the data of user and product will be sent by email to admin so far everything is working but I also want to save these data that been sent by email in other table as <code>Order_table</code> and show it to user in their panel that they've been requested to buy those item and if the items been paid or not yet.</p>
  
  <p>Question:
  How to save these data in table include sum the price base on selected quantity by user?</p>
  
  <p>this is my form that is in my items page:</p>
  
  <pre><code>&lt;form class="form-horizontal" action="{{route('ask_product')}}" method="POST"  id="contact_form"&gt;
              {{ csrf_field() }}
  
              &lt;div class="form-group"&gt;
                &lt;label class="col-md-3 control-label"&gt;UserName&lt;/label&gt;
                &lt;div class="col-md-9 inputGroupContainer"&gt;
                  &lt;div class="input-group"&gt;
                    &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-user"&gt;&lt;/i&gt;&lt;/span&gt;
                    &lt;input  name="username" value="{{ Auth::user()-&gt;username }}" class="form-control"  type="text" readonly&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;!-- Text input--&gt;
              &lt;div class="form-group"&gt;
                &lt;label class="col-md-3 control-label"&gt;E-Mail&lt;/label&gt;
                  &lt;div class="col-md-9 inputGroupContainer"&gt;
                  &lt;div class="input-group"&gt;
                      &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-envelope"&gt;&lt;/i&gt;&lt;/span&gt;
                      &lt;input name="email" value="{{ Auth::user()-&gt;email }}" class="form-control"  type="text" readonly&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                &lt;label class="col-md-3 control-label"&gt;Product&lt;/label&gt;
                &lt;div class="col-md-9 inputGroupContainer"&gt;
                  &lt;div class="input-group"&gt;
                    &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-product-hunt"&gt;&lt;/i&gt;&lt;/span&gt;
                    &lt;input  name="product" value="{{ $product-&gt;title }}" class="form-control"  type="text" readonly&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                &lt;label class="col-md-3 control-label" for="type"&gt;Quantity&lt;/label&gt;
                &lt;div class="col-md-9 inputGroupContainer"&gt;
                  &lt;div class="input-group"&gt;
                    &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-file-code-o"&gt;&lt;/i&gt;&lt;/span&gt;
                    &lt;select class="form-control" id="type" name="quantity"&gt;
                      &lt;option value=""&gt;Select Quantity&lt;/option&gt;
                      &lt;option value="1"&gt;1&lt;/option&gt;
                      &lt;option value="2"&gt;2&lt;/option&gt;
                      &lt;option value="3"&gt;3&lt;/option&gt;
                      &lt;option value="4"&gt;4&lt;/option&gt;
                      &lt;option value="More than 5"&gt;More than 5&lt;/option&gt;
                    &lt;/select&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                &lt;label class="col-md-3 control-label"&gt;Note to seller&lt;/label&gt;
                &lt;div class="col-md-9 inputGroupContainer"&gt;
                  &lt;div class="input-group"&gt;
                    &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-commenting-o"&gt;&lt;/i&gt;&lt;/span&gt;
                    &lt;textarea name="note" id="text" placeholder="Your note to seller here..." class="form-control" rows="8" &gt;&lt;/textarea&gt;
                  &lt;/div&gt;
                  &lt;h6 class="pull-right" id="count_message"&gt;&lt;/h6&gt;
                &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="text-center"&gt;
                &lt;input type="submit" class="btn btn-block btn-success" value="Send"&gt;
              &lt;/div&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>this is the form validator and email sender:</p>
  
  <pre><code>public function ask() {
        return view('frontend.shopsingle');
      }
  
      public function postask(Request $request) {
        $this-&gt;validate($request, array(
          'username' =&gt; 'required',
          'email' =&gt; 'required|email',
          'product' =&gt; 'required',
          'note' =&gt; 'required|min:10|max:500',
          'quantity' =&gt; 'required',
        ));
  
        $data = array(
          'username' =&gt; $request-&gt;username,
          'email' =&gt; $request-&gt;email,
          'product' =&gt; $request-&gt;product,
          'note' =&gt; $request-&gt;note,
          'quantity' =&gt; $request-&gt;quantity,
        );
  
        Mail::send('emails.ask', $data, function($message) use ($data) {
          $message-&gt;from($data['email']);
          $message-&gt;to('robertnicjoo@outlook.com');
          $message-&gt;subject($data['product']);
        });
  
        Session::flash('flash_message', 'Your Order was sent. Our sell team will contact you shortly.');
        return redirect()-&gt;back();
  
      }
  </code></pre>
  
  <p>here are my routes for that form:</p>
  
  <pre><code>    Route::get('/ask', 'ContactController@ask')-&gt;name('ask_product');  
  
  Route::post('/ask', 'ContactController@postask');
  </code></pre>