title: Laravel - Hash input using SHA512
body: <p>I am creating an API POST request, but I want to hash some of the user input (referenceID and phone_no) and save into hash field using SHA512. I want to put it in the Controller.</p>
  
  <p>I have create the Model Class and also the Controller</p>
  
  <p>Model</p>
  
  <pre><code>    protected $fillable = [
          'referenceID' ,
          'phone_no',
          'hash'
      ]; 
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>    public function store(Request $request)
      {
          $request-&gt;validate([
              'referenceID' =&gt; 'required',
              'phone_no' =&gt; 'required',
          'hash' =&gt; 'required'
          ]);
  
          $valrequest = Task::create($request-&gt;all());
  
          return response()-&gt;json([
              'message' =&gt; 'Great success! New validation request created',
              'valrequest' =&gt; $valrequest, 201
          ]);
      }
  </code></pre>
  
  <p>I want to hash the user input (referenceID and phone_no) and save into the hash field using SHA512. I want to put it in the Controller. How do I do this.</p>