title: Total price calculation by quantity
body: <p>I know this is a very basic question. But I didn't find the answer on the internet. </p>
  
  <p>Here is my database: </p>
  
  <pre><code>        $table-&gt;string('title');
          $table-&gt;integer('quantity');
          $table-&gt;double('price');
          $table-&gt;double('total')-&gt;nullable();
  </code></pre>
  
  <p>I just want to calculate the total price by multiplying price * quantity. </p>
  
  <p>Where should I do this? In controller or model? </p>
  
  <p>Here is the controller:</p>
  
  <pre><code>        Item::create([
          'quantity' =&gt; $request-&gt;get('quantity'),
          'price' =&gt; $request-&gt;get('price'),
      ]);
  </code></pre>
  
  <p>Thanks </p>