• 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

set mail driver dynamically from database for different email in notification

What will the best solution for this multiple optional filter?

PHP7 CLI attempts to load xdebug twice - "Cannot load Xdebug - it was already loaded"

WordPress Security Standards want me to escape my html, but how to do it correctly?

Send same name multiple checkbox values via ajax

jQuery Ajax Post with data

Phpunit partial mock + proxy Entity

jQuery Ajax Post with data

Which is faster php date functions or carbon?

How to test a php login connected to a mysql db through xampp?

Unable to guess the mime type as no guessers are available Laravel 5.2

How to extract price from given url using Xpath?

Batch request Google Calendar php API

javascript html popup window

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

About Contact Privacy policy Terms and conditions