• 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

Ajax GET request fails in laravel 8

How to submit a form when page loads using JavaScript?

Prestashop webservice API creating cart rules

php script to delete files older than 24 hrs, deletes all files

Laravel update hasMany relationship using saveMany

passwordless LDAP login and get user information using Kerberos ticket in PHP

Transpose csv file data [duplicate]

With doctrine ODM, can I embed many subdocuments in a main document?

find in set in laravel ? example

Can I use a WooCommerce function without any WooCommerce page?

Webscraping Symfony/Panther: Can't get HTML

wp_remote_get() not passing authentication

Call authenticate manually in router middleware

send email using gmail-api and google-api-php-client

Add restriction to WooCommerce coupons by allowed user ID

About Contact Privacy policy Terms and conditions