title: Laravel 5.2 Modify Request After Form Validation Before Controller
body: <p>I'm using laravel 5.2 and i'm using Form Request that given by laravel vendor to make my code clean, so i don't have many code on my controller :</p>
  
  <pre><code>public function store( CouponRequest $request )
  {
      DB::beginTransaction();
      try {
          $coupon = Coupon::create( $request-&gt;all() );
  
          DB::commit();
          return redirect()-&gt;route('admin.coupons.index');
      } catch (\Exception $e) {
          DB::rollback();
          return redirect()-&gt;back()-&gt;withInput();
      }
  </code></pre>
  
  <p>And this is my sample code about my request form :</p>
  
  <pre><code>public function rules()
  {
      switch ( strtolower( $this-&gt;method ) ) {
          case 'post':
          {
              return [
                  'code' =&gt; 'required|unique:coupons,code',
                  'name' =&gt; 'required',
                  'start_year' =&gt; 'required',
                  'start_month' =&gt; 'required',
                  'start_day' =&gt; 'required',
                  'start_time' =&gt; 'required',
                  'finish_year' =&gt; 'required',
                  'finish_month' =&gt; 'required',
                  'finish_day' =&gt; 'required',
                  'finish_time' =&gt; 'required',
                  'using_time' =&gt; 'required',
                  'type' =&gt; 'required',
                  'free_shipment' =&gt; 'required',
                  'target' =&gt; 'required',
                  'target_user' =&gt; 'required'
              ];
          }
          case 'put':
          {
              return [
                  'code' =&gt; 'required',
                  'name' =&gt; 'required',
                  'start_year' =&gt; 'required',
                  'start_month' =&gt; 'required',
                  'start_day' =&gt; 'required',
                  'start_time' =&gt; 'required',
                  'finish_year' =&gt; 'required',
                  'finish_month' =&gt; 'required',
                  'finish_day' =&gt; 'required',
                  'finish_time' =&gt; 'required',
                  'using_time' =&gt; 'required',
                  'type' =&gt; 'required',
                  'free_shipment' =&gt; 'required',
                  'target' =&gt; 'required',
                  'target_user' =&gt; 'required'
              ];
          }
          default:
          {
              return [];
          }
      }
  }
  </code></pre>
  
  <p>Where should i place this command? :</p>
  
  <pre><code>$start_date = Carbon::create( $request-&gt;start_year, $request-&gt;start_month, $request-&gt;start_day );
  $start_date-&gt;setTimeFromTimeString( $request-&gt;start_time );
  $finish_date = Carbon::create( $request-&gt;finish_year, $request-&gt;finish_month, $request-&gt;finish_day );
  $finish_date-&gt;setTimeFromTimeString( $request-&gt;finish_time );
  </code></pre>
  
  <p>If i place this code before validation, i could be error when some field not filled well by users.</p>
  
  <p>So what i want is to place this code after validation success, but i don't want to place it at my controller.</p>
  
  <p>Is there FormRequest function that can be called after validation success to modify my request??</p>
  
  <p>I think it's not good when there's much code at controller, so i want to minimalize my controller code.</p>