• 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 search for a file with php

RabbitMQ PRECONDITION_FAILED - unknown delivery tag

Get all WooCommerce products within own plugin

CONCAT columns with Laravel 5 eloquent

Yii2 redirecting to previous page after login

How to fix 'Data has already been sent to output, unable to output PDF file' in MPDF

Laravel Command Schedule Not Working Properly

Add 2 Webcam in one page with WebcamJS

Get WooCommerce products from specific category

dockerizing Laravel + vue

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

Laravel 5: Is there a non-case sensitive way to sort a collection by an attribute?

Store multiple fields in JSON column (Nova CMS)

Symfony process run throws exception - executing on command line works

How in Laravel run JavaScript code stored in php variable?

About Contact Privacy policy Terms and conditions