• 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

Laravel Model save() & update() Not Saving

Get WooCommerce product variation attribute terms in admin products general box

Adding reCAPTCHA v2 into my PHP file

Add 2 Webcam in one page with WebcamJS

The difference when using if statement true === something() vs something() === true [duplicate]

MySQL upgrade causing unexpected results on simple WHERE clauses

Laravel 5.1 Unknown database type enum requested

Vimeo API: how to save a vimeo into a subfolder?

laravel sanctum Route [login] not defined

Laravel Mix Uncaught ReferenceError: $ is not defined

Why rand() every time I refresh the page?

Natural ORDER in Laravel Eloquent ORM

How to render html from a @foreach loop in a textarea

IlluminateDatabaseQueryException: SQLSTATE[HY000]: General error: 1 no such table - In clone project

(PHPUnit) PHP Fatal error: Uncaught Error: Call to undefined function each()

About Contact Privacy policy Terms and conditions