• 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 to render html from a @foreach loop in a textarea

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

How to debug in WooCommerce 3+

Dynamic dropdown Ajax PHP request

Mysqli Output to a table

Sync Records With Default Values in Pivot Tables, Call to undefined method syncWithPivotDefaults()

Handling expired token in Laravel

MySQL upgrade causing unexpected results on simple WHERE clauses

Unit (real unit test) of test laravel relationship

Yii Ajax Submit button

Apply session id from request header

PHPExcel How to set conditional formatting to change cell background color based on cells values

Ajax GET request fails in laravel 8

Maatwebsite Excel 3.1 : how do I skip duplicate data when imported?

Laravel unique validation on multiple columns

About Contact Privacy policy Terms and conditions