• 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

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

How to put php code inside opening and closing shortcodes

Can't find vendor/autoload.php for Ratchet

Yii2 select2 database exception number of bound variables does not match number of tokens

Display Link Title Instead of URL in XSL

How to send image,audio or video through the WhatsApp API - PHP

Laravel Factory not calling callback 'afterCreating'

LARAVEL: How to fetch id dynamically in a query builder?

Return new collection without modifying original collection

OAuth2 Token PHP

Log a user out of a website when they put their computer to sleep

Last order would be re-order in wooCommerce. How is it possible?

How to Display Data in Yajra Datatables Laravel 7?

Could not decode a text frame as UTF-8.

Laravel s3 upload file with metadata using pre-signed url

About Contact Privacy policy Terms and conditions