• 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

Laravel 5.1 Unknown database type enum requested

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

Laravel update hasMany relationship using saveMany

Assets not referencing to public folder (Laravel)

How do I refresh a DIV content?

How to remove from a multidimensional array all duplicate elements including the original?

Laravel Blade checkbox not checked

Store multiple fields in JSON column (Nova CMS)

php code to send checkbox form results to email

Combine multiple columns into an array as one of the key in a results set

How to set time with DateTime modify?

Laravel get user data with profile

php curl_exec() Connection refused when retrieving a remote image

enroll_table three field fetch to payment form to create payment field in laravel 5.5

Why getting "Build step 'Execute shell' marked build as failure" error while creating a backup tar for files

About Contact Privacy policy Terms and conditions