• 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

merge all files in directory to one text file

Laravel PackageManifest.php: Undefined index: name

How to show selected value using javascript in laravel

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

PHP web3 ERC20 token function call

Connecting an HTML webpage to a SQL Server

Add customer email and phone in "Order" column to admin orders list on Woocommerce

Login if user is active using Laravel Breeze

Cant seem to get the Pagination to work on my WooCommerce REST API application?

Unsure why I am getting: Number of variables doesn't match number of parameters in prepared statement

How to properly set "0000-00-00 00:00:00" as a DateTime in PHP

How do I upload a laravel project on cPanel shared hosting?

Center point of multiple gps coordinates with php

PHP 8.1: strftime() is deprecated

How to get the survey List from surveygizmo API in the Postman?(Trial Version)

About Contact Privacy policy Terms and conditions