• 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

How do I truncate a decimal in PHP?

Laravel Delete and Update

301 Redirect to remove query string on homepage only

Yii2: How to download backup files using spanjeta/yii2-backup?

Sliders in Laravel

GRPC installed successfully on ubuntu but php is looking for it in another folder

strpos(): Argument #1 ($haystack) must be of type string, array given

How to generate QR CODE for dynamic generating link and logo using Simple QrCode in laravel?

How do I do HTTP basic authentication using Guzzle?

Laravel Gates using model and returns "Using $this when not in object context" Line 28 of AzureUser model

How to use a PHP MVC Controller, one thats invoked by calling a URL, to call and execute more than one function? [duplicate]

Center point of multiple gps coordinates with php

Doctrine 2 mapping referencing unique key

how to check version of codeigniter framework?

Results page in other window

About Contact Privacy policy Terms and conditions