• 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

Add and update products to session cart in Laravel

printing all running session variable in laravel 5.1

PHP web3 ERC20 token function call

How in Laravel run JavaScript code stored in php variable?

Show only featured products in Woocommerce shop page

PHP file_get_contents function

Laravel: Why is my variable not being set while it's in the construct function of the controller?

how to prevent float variables displaying as scientific notation when printing [duplicate]

Codeigniter, Severity: error --> Exception: Too few arguments to function, admin dashboard shows HTTP error 500

How to reset Laravel AuthManager/guards in between API calls in tests?

Uncaught TypeError: Cannot read property 'length' of null when retrieving tags from wp

java URL working on browser but not in client program

How to edit Records using CodeIgniter

Make survey at laravel 5.4 and MySQL

Pass an image through AJAX [duplicate]

About Contact Privacy policy Terms and conditions