• 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

PHP array_filter with arguments

Object of class stdClass could not be converted to string error

Dropdown with current value from Mysql

Laravel Get Days In Month From Month Number?

Symfony 4: "Autowire: you should configure its value explicitly."

AJAX call fails with SyntaxError: Unexpected end of JSON input

How to create custom authentication in laravel 8?

PHPExcel file download using AJAX call

How can I make Laravel return a custom error for a JSON REST API

Must be of the type array, null given,

Increase value by 1 on button click

How can i update or reset my password without entering email field in laravel-8?

The sum of the user's points

selected value from the listbox in php

I want to display default profile image if user do not have profile image

About Contact Privacy policy Terms and conditions