• 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

How can I easily switch between PHP versions on Mac OSX?

Timber: Single post pagination does not work (wp_link_pages)

how to loop through json response data using ajax jquery?

IlluminateDatabaseQueryException: SQLSTATE[HY000]: General error: 1 no such table - In clone project

Normalize DateInterval in PHP

How to make Canonicals with PHP

Log a user out of a website when they put their computer to sleep

Update Total in checkout of Woocommerce with Ajax Request

Load a .env file with PHP

500 (Internal Server Error) with Laravel & Docker [duplicate]

Converting array to string and then back in PHP

shell errors running php exec

Cross-Origin Resource Sharing (CORS) witth Laravel and Vuejs

Yii2 select2 database exception number of bound variables does not match number of tokens

browsersync doesn't work with XAMPP

About Contact Privacy policy Terms and conditions