• 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

Lexik JWT authentication problem "Invalid credentials"

woocommerce change position of price

Get sum of arrays inside array

php: command not found Command PhaseScriptExecution failed with a nonzero exit code

Get sql.h error on MacOS 12 (Monterey) sqsrv and pdo_sqsrv drive installation

file_put_content...fail to open stream:Permission denied in Laravel 5

PHP password_verify

MySQL - Connection failed: No route to host

Center point of multiple gps coordinates with php

Results page in other window

How to reset Laravel AuthManager/guards in between API calls in tests?

phpseclib 2.0 can not use Composer to create autoload

AJAX call fails with SyntaxError: Unexpected end of JSON input

Reorder attribute dropdown terms in Woocommerce single variable products

ldap is missing from system when installing adldap2 in laravel

About Contact Privacy policy Terms and conditions