title: how to redirect to post page when payment is done in laravel
body: <p><strong>how can i send back to payment page which is post type</strong></p>
  <pre><code>My routes
  Route::post('/payment', 'PaymentsController@getPayment')-&gt;name('/payment');
  Route::post('/charge', 'PaymentsController@payPayment');
  </code></pre>
  <p><strong>My controller</strong></p>
  <pre><code> first method for post requests
  public function getPayment(Request $req)
    {
      $csdetails = array(['courseid' =&gt; $req['courseid'] , 'coursename' =&gt; $req['coursename'], 'courseprice' =&gt; $req['courseprice']]);
      //dd($csdetails);
      return view('/payment')-&gt;with('csdetails', $csdetails); 
    }
  </code></pre>
  <p>second method after select to purchase</p>
  <pre><code>public function payPayment(Request $request)
    {
  
      $price=$request-&gt;courseprice;
      $this-&gt;validate($request, [
              'card_no' =&gt; 'required',
              'expiry_month' =&gt; 'required',
              'expiry_year' =&gt; 'required',
              'cvv' =&gt; 'required',
          ]);
        //$stripe = Stripe\Stripe::setApiKey(env('STRIPE_SECRET'));
  
        $stripe = Stripe\Stripe::setApiKey('sk_test_bCgnRBd3BoVvH6QU3gBPbBkQ');
        try {
              $response = \Stripe\Token::create(array(
                  &quot;card&quot; =&gt; array(
                      &quot;number&quot;    =&gt; $request-&gt;input('card_no'),
                      &quot;exp_month&quot; =&gt; $request-&gt;input('expiry_month'),
                      &quot;exp_year&quot;  =&gt; $request-&gt;input('expiry_year'),
                      &quot;cvc&quot;       =&gt; $request-&gt;input('cvv')
                  )));
                  if (!isset($response['id'])) {
                  return redirect()-&gt;route('payment');
              }
  
              $charge = \Stripe\Charge::create([
                  'card' =&gt; $response['id'],
                  'currency' =&gt; 'USD',
                  'amount' =&gt;  $price,
                  'description' =&gt; 'wallet',
              ]);
  
  
               if($charge['status'] == 'succeeded') {
  </code></pre>
  <p><strong>here iam getting error of get method because it is getting post type data on payment page</strong></p>
  <pre><code>                return redirect('payment')-&gt;with('success', 'You Purchased A Courses Successfully!');
  
              } else {
                  return redirect('payment')-&gt;with('error', 'something went to wrong.');
              }
          }
          catch (Exception $e) {
              return $e-&gt;getMessage();
          }
    }
  }
  </code></pre>
  <p><strong>Please help me how to i redirect to payment page whic is post type and save the values in db here</strong></p>