title: Laravel action when form validation generates error
body: <p>I am working with a form request file like this:
  <code>ProjectCreateRequest.php</code></p>
  
  <pre><code>public function rules()
    {
      $project_name = $this-&gt;project_name;
      $meta_activity = $this-&gt;meta_activity;
      return [
        'project_name' =&gt; 'required|max:255|unique:projects',
        'customer_name' =&gt; 'required|max:255',
        'otl_project_code' =&gt; 'sometimes|max:255|unique:projects,otl_project_code,NULL,id,meta_activity,'.$meta_activity,
        'estimated_start_date' =&gt; 'date',
        'estimated_end_date' =&gt; 'date',
        'LoE_onshore' =&gt; 'numeric',
        'LoE_nearshore' =&gt; 'numeric',
        'LoE_offshore' =&gt; 'numeric',
        'LoE_contractor' =&gt; 'numeric',
        'revenue' =&gt; 'numeric',
        'win_ratio' =&gt; 'integer'
      ];
    }
  </code></pre>
  
  <p>There is the <code>otl_project_code</code> that must be unique with the meta_activity.</p>
  
  <p>In case someone enters a pair of <code>otl_project_code</code> and <code>meta_activity</code> that already exists, it goes back to the create page with the error written below.</p>
  
  <p>I would like to get instead that in the controller, I can catch this information, do something on the database then redirect to an update url.</p>
  
  <p>Because I am working with a form validation request file, everything is entered in my controller like this:</p>
  
  <pre><code>public function postFormCreate(ProjectCreateRequest $request)
  </code></pre>
  
  <p>and I don't know how to catch this specific error in my controller to execute some actions with all the fields I submitted and not go back to the create page. Of course, this needs to happen only when there is the specific error I mentionned above.</p>