• 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 controller function parameters

Dropzone: Submit both form data and dropzone at once

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

html-php form submission after validation through JavaScript [closed]

PHP Find Array Index value in multi-line array

How can I create a Download Page with post php method?

How to to send mail using gmail in Laravel?

How to convert the int value to inch in PHP [closed]

dockerizing Laravel + vue

codeigniter 4 running error first time with xampp

Sagepay Error The Vendor failed to provide a RedirectionURL

Testing subscription renewals on Stripe

Laravel views are showing from cache on one server but works fine on other server

Create a new line whenever an array value reaches more than 10 characters

Utf8 encoding issue with Laravel

About Contact Privacy policy Terms and conditions