• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Parameter is not sent to Laravel route in Ajax

javascriptphpajaxlaravellaravel-5.8


PHP Snippet 1:

let url = "{{ route('payCourseRegistrationWithDiscount',['course'=>$item->cor_id,'value'=>':cartValueDiscountedWithCode']) }}";
url = url.replace(':cartValueDiscountedWithCode', data.cartValueDiscountedWithCode);
window.location.href = url;

PHP Snippet 2:

window.location.href = {{route('payCourseRegistrationWithDiscount', ['course'=>$item->cor_id]) }}}+'/'+data.cartValueDiscountedWithCode

Related Snippets

Can't remotely connect to MySQL error (13) with PHP script, connecting through CLI works

Limit WooCommerce products in cart only from one custom taxonomy

Group data in a multidimensional array based on two columns

How can I make Laravel return a custom error for a JSON REST API

how to use extended ASCII instead of unicode in PHP

500 (Internal Server Error) with Laravel & Docker [duplicate]

how to loop through json response data using ajax jquery?

Store multiple fields in JSON column (Nova CMS)

Cross-Origin Resource Sharing (CORS) witth Laravel and Vuejs

Symfony run hint kernel.secret parameter not found

How to send upload image through email

How do I Post to .txt document before form submits

WooCommerce: Add/display Product or Variation custom field everywhere

401 Unauthorized only occurring on some pages in Laravel 8

How To Access A Column In M-M Relationship Table In Laravel

About Contact Privacy policy Terms and conditions