• 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

Change the alert text on add to cart action without selected variation in Woocommerce

Using Associative arrays

how to sort by a custom appended relation to model

How do I upload a laravel project on cPanel shared hosting?

printing all running session variable in laravel 5.1

PHP drop down list using array's and foreach (else and for) code

Limit login attempts in Laravel 5.7

Can't find vendor/autoload.php for Ratchet

Valet, Xdebug after reboot Big Sur not working

renameColumn migration fails for existing column with columns does not exist error

How to get an Array value inside an object in an array Php [duplicate]

Laravel UUID generation

Laravel Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) on a sub query with "ROW_NUMBER() OVER PARTITION"

PHP: convert all UTF-8 characters to HTML entities

PHP -> Next nearest date defined by array of days in week

About Contact Privacy policy Terms and conditions