• 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

Chunk and transpose a flat array into rows with a specific number of columns

Creating live search with AJAX and CodeIgniter

Log a user out of a website when they put their computer to sleep

how to fix Service provider class not found when using repository?

Get all WooCommerce products within own plugin

PHP SoapClient: set a namespace without prefix

How do I call Validator from a namespace with an already existing Validator class

Magento 2 - Controller returning blank page

What is my SQL missing?

how to sort by a custom appended relation to model

How to convert a carbon into string, to take the date only?

How to to send mail using gmail in Laravel?

Adding the custom page with add_menu_page function on Wordpress

Laravel Unresolvable dependency resolving [Parameter #0 [ <required> $method ]] in class GuzzleHttpPsr7Request

Transform array, set each array element with parent key php

About Contact Privacy policy Terms and conditions