• 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

Passing a boolean value from checkbox in Laravel form

PHP mail sending empty mails

How to install php yaml on CentOs?

Star and Half Star Rating in Laravel

Laravel Get Days In Month From Month Number?

Laravel whole batch is cancelled if one Job fails

How to install PHP composer inside a docker container

jQuery Ajax Post with data

SMTP ERROR: MAIL FROM command failed: 530 5.7.0 Must issue a STARTTLS command first when using PHPMailer

How to read laravel_session cookies saved in cookie memory of browser in client side?

Laravel: HTML in notification

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

How to submit a form when page loads using JavaScript?

Check if user online laravel

Laravel: Why is my variable not being set while it's in the construct function of the controller?

About Contact Privacy policy Terms and conditions