title: controller method is not working and page is refreshing instead of redirecting to given path in laravel
body: <p>I am not getting any error, it's just refreshing on that page. The controller method is not called where I have given the path for redirection.
  My code is:</p>
  
  <p><strong>blade-file</strong></p>
  
  <pre><code> &lt;form action="{{route('validate-promocode')}}" method="post"&gt;
                        @csrf
                      &lt;input class="promo-input" id="code" type="text" onkeyup="this.value = this.value.toUpperCase();" name="code" placeholder="EG. APPLY HERE"&gt;&lt;br&gt;
                      &lt;input type="hidden" name="_token" value="{!!csrf_token()!!}"&gt;
                      &lt;button id="save" type="submit" class="apply-promo"&gt;Apply Promo Code&lt;/button&gt;
                      &lt;/form&gt;  
  </code></pre>
  
  <p><strong>Route file</strong></p>
  
  <pre><code>Route::post('/validade-code', 'PromoController@validateCode')-&gt;name('validate-promocode');
  </code></pre>
  
  <p><strong>Controller file</strong></p>
  
  <pre><code>public function validateCode(Request $request){
        if (Gate::allows('isUser')) {
            $ip = $request-&gt;input('code');
            dd($promo);
          $promo = Promo::where('code','=', trim($ip))-&gt;first();
  
          if(!empty($promo)){
            $dataamountMonthly =  40000  - (($promo-&gt;discount_percentage * 40000) / 100);
            $dataamountYearly  =  300000  - (($promo-&gt;discount_percentage * 300000) / 100);
  
            if($dataamountMonthly == 0 || $dataamountYearly == 0){
  
  
              return view('paymet.subscription-success');
          }
            $data = array(
                'dataamountMonthly' =&gt; $dataamountMonthly ,
                'dataamountYearly'  =&gt; $dataamountYearly,
                'code' =&gt; $ip
            );
  
            return view('payment.startPromoCode',$data);
  
          }else{
            $data = array(
                'error' =&gt; 'Something went wrong, please try again'
            );
           return redirect()-&gt;back()-&gt;with($data);
          }
        }
    }
  </code></pre>
  
  <p>I don't know what I am missing , any help will be appriciated.</p>