• 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

Do I need to install `fxp/composer-asset-plugin` if I'm not doing front-end development

Getting values for an enum?

How to Mock the Request Class in Laravel?

How to get rid of ampersand using WP Nonce URL and WP Redirect or PHP header

Create a zip file and download it

get data-value with variable value

If action is on a different page do I use fwrite function

PHP array sort and remove duplicates by two field values

How to install PHP composer inside a docker container

How to add a custom field to all Woocommerce attribute terms using add_action

zsh: command not found: php

Send same name multiple checkbox values via ajax

Laravel You requested 1 items, but there are only 0 items available

how to check version of codeigniter framework?

onKeyUp event calculation not working on the following rows from php generated forms except the first one

About Contact Privacy policy Terms and conditions