• 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

Why is this PHP array not the same?

Set quantity minimum, maximum and step at product level in Woocommerce

Is there an equivalent of DynamoDB on Azure as a PHP session Handler

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

How to show selected value using javascript in laravel

Respond with status code 401 on authentication failure using Laravel and Passport?

Using PHP to connect to a remote MSSQL database

GuzzleHttp Hangs When Using Localhost

Docker & Laravel : configure: error: Package requirements (oniguruma) were not met

Get WooCommerce products from specific category

how to make my own auto increment in php?

Convert every two values of an associative array into key-value pairs

Laravel - Browser displays message again when I press back button

Get orders by date and status woocommerce

Changing font color in javascript

About Contact Privacy policy Terms and conditions