• 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

storagelogs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

Access relation of pivot table in Laravel

Handle error for duplicate entries - PHP/MySQL

Sum column values from multiple arrays

Accessors (Getter) & Mutators (Setter) On a Pivot Table in Laravel

Laravel print last executed SQL query with Query log

laravel sanctum Route [login] not defined

PHP date() with timezone?

Saving Data from form to database using AngularJS and php

Component install error: JInstaller: :Install: File does not exist

How to find the date a user created their Google account

Get WooCommerce products from specific category

How to properly start Laravel 8 with Bootstrap & authentication

MySQL/PHP - Web Based Game -User specific inventory table or 1 giant table? Another option?

Adding multiple items to WooCommerce cart at once

About Contact Privacy policy Terms and conditions