• 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

Two buttons one form

Coinpayments create_transaction "ERROR: Invalid command!"

Limit WooCommerce products in cart only from one custom taxonomy

JSON Render Issue in Date Object Laravel and PHP 7.4

PHP - Check if string contains words longer than 4 characters, then include "+ *", and for those shorter than 4 characters include only "*"

How to get array values using foreach in laravel

Having issue with matching rows in the database using PDO

Symfony Mercure "Failed to send an update"

Target Individual Form Instance/Counter Inside A PHP While Loop

How to check user Permissions using Custom Middleware in Laravel

Connecting an HTML webpage to a SQL Server

laravel MVC execution flow

How to convert a carbon into string, to take the date only?

How can I make a full text index of the column?

how to search for a file with php

About Contact Privacy policy Terms and conditions