• 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

Show only featured products in Woocommerce shop page

how to sort by a custom appended relation to model

Center point of multiple gps coordinates with php

enable Apache http Authorization header

Apply filter array/return terms

Submitting a form with ajax in Wordpress

Laravel Mix Uncaught ReferenceError: $ is not defined

How to make a foreign key not using primary key

Yii2 redirecting to previous page after login

echo language construct is discouraged. (PHP)

get data-value with variable value

Creating live search with AJAX and CodeIgniter

add_action() function in wordpress not working [duplicate]

Transpose and flatten multiple rows of array data [duplicate]

Hide specific products from unlogged users based in product category in WooCommerce

About Contact Privacy policy Terms and conditions