• 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

shell errors running php exec

How to change 'users' auth table and use another instead Laravel

Access relation of pivot table in Laravel

how to get value from array in laravel

target [LaravelFortifyContractsRegisterViewResponse] is not instantiable

Remove product downloads section in woocommerce email notifications

Login if user is active using Laravel Breeze

Get image type from base64 encoded src string

HTML and PHP in one file

get folder directory from input type file - PHP

Error when uploading certain .png files "Interlace handling should be turned on when using png_read_image"

How to get an Array value inside an object in an array Php [duplicate]

str_word_count() function doesn't display Arabic language properly

Laravel 5 session not persisting after user is logged in

Laravel Model save() & update() Not Saving

About Contact Privacy policy Terms and conditions