• 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

Filter array by skipping every nth element from the end

Redirect to previous page with php

How to get unique slug to same post-title for other time too?

Modify microseconds of a PHP DateTime object

How to to send mail using gmail in Laravel?

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

Symfony autowiring issues since docker update

Required field only if another field has a value, must be empty otherwise

Prestashop cUrl Login

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

How to get values inside <![CDATA[values]] > using php DOM?

Query Optimization, changing the queries in the loop into a single processing query

Apply filter array/return terms

SQLSTATE[HY000]: General error: 1 table posts has no column named *

Combine multiple columns into an array as one of the key in a results set

About Contact Privacy policy Terms and conditions