• 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

How to map the two arrays with a duplicate value?

how to identify the web server name of remote host

How to access a var with "-" in PHP [duplicate]

Assets not referencing to public folder (Laravel)

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'posts.post' doesn't exist

php curl_exec() Connection refused when retrieving a remote image

Add Class in html Dynamically in PHP

PHP Include for HTML?

HTTP Range requests with php for Video Embedding for solving going to specific time in video (seek bar not work)

php echo remove slashes from url [duplicate]

How to assert parameter attribute sub-structures in PHPUnit mock call expectations

PHP rotate matrix counter-clockwise

How to convert time from one timezone to another in PHP

Laravel implode array items to new lines

Yii2 redirecting to previous page after login

About Contact Privacy policy Terms and conditions