• 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

Store / Website Column in Magento 2 Admin Grid - Custom Module

Too few arguments to function PendingResourceRegistration::name(),1 passed in C:xampphtdocsproject outesweb.php on line 18 and exactly 2 expected

How to set time with DateTime modify?

Laravel-fopen: failed to open stream: Permission denied

jQuery Ajax Post with data

Comma separated list from array with "and" before last element

target [LaravelFortifyContractsRegisterViewResponse] is not instantiable

Display a product custom field only in WooCommerce Admin single orders

Inserting Country Selection into MySQL PHP [duplicate]

Batch request Google Calendar php API

JSON Render Issue in Date Object Laravel and PHP 7.4

Laravel - Browser displays message again when I press back button

How to map the two arrays with a duplicate value?

Star and Half Star Rating in Laravel

javascript html popup window

About Contact Privacy policy Terms and conditions