• 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

Creating a config file in PHP

Reading input in php from terminal

Check if user online laravel

Is there a way to use Foundry Model for Authentification inside Functional Tests?

Filter WooCommerce products with post__in and additional meta queries

Declaration of OMDb::query(string $statement) must be compatible with PDO::query

Utf8 encoding issue with Laravel

Laravel update hasMany relationship using saveMany

send email using gmail-api and google-api-php-client

laravel MVC execution flow

storagelogs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

Insert a DIV after the 6th product only once in WooCommerce category archives

Laravel Blade checkbox not checked

How to read laravel_session cookies saved in cookie memory of browser in client side?

nginx err_connection_refused, can anyone help me?

About Contact Privacy policy Terms and conditions