• 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 MVC execution flow

How to unlink image from folder?

How to trim a video by 4 fragments to 4 seconds using the PHP-FFMpeg?

Split comma separated value from table column into rows using mysql?

WAMP/Wordpress - cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received

Laravel UUID generation

Access denied for user 'homestead'@'localhost' (using password: YES)

Laravel Excel::store file empty after stored

How to show selected value using javascript in laravel

Star rating with half star support

Get keys from associative array [duplicate]

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

Woocommerce Edit Message "An account is already registered with your email address. Please log in."

Performance of foreach, array_map with lambda and array_map with static function

How to average columns of data from multiple, flat arrays?

About Contact Privacy policy Terms and conditions