• 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

phpmyadmin : Depends: php-twig (>= 2.9) but 2.6.2-2 is to be installed. WHAT?

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null

Unsure why I am getting: Number of variables doesn't match number of parameters in prepared statement

Woocommerce redirect after add-to-cart error

Too few arguments to function PendingResourceRegistration::name(),1 passed in C:xampphtdocsproject outesweb.php on line 18 and exactly 2 expected

Center point of multiple gps coordinates with php

How to unlink image from folder?

The sum of the user's points

Toggle between a textbox and a select using PHP

How can I remove the "Advanced" panel of all blocks in WordPress block editor?

Update Total in checkout of Woocommerce with Ajax Request

Must be of the type array, null given,

CSV to PHP class properties

wordpress : How to specify the cause "This site can’t be reached"

Manage independently the decimal number of the price of each product [duplicate]

About Contact Privacy policy Terms and conditions