• 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

Attempt to read property "view" on null when sending password reset email

Using array_intersect on a multi-dimensional array

Laravel relationship belongsToMany with composite primary keys

Encrypt in php and decrypt in Dart(flutter)

How to prevent phpmailer sending embedded image as an attachment on Gmail?

Issue saving card for customer

Boolean assignment operators in PHP

Target Individual Form Instance/Counter Inside A PHP While Loop

how to make my own auto increment in php?

Filter WooCommerce related products by Polylang language

How to use React Router with Laravel?

php code to send checkbox form results to email

Laravel - Browser displays message again when I press back button

Group rows by column and sum another column within groups [duplicate]

Get latest Tweets - What API

About Contact Privacy policy Terms and conditions