Reputation: 35
I have an laravel application and also included an php file for a Payment Package,im Passing two url parameters from my laravel route to this Php File .How can i access the passed url parameters in this Php file.
Route::get('payumoneypayment/{courseid}/{userid}', function() {
include_once(app_path() . '/payu/index.php');
});
The route passed from laravel is like this eg http://127.0.0.1:8000/payumoneypayment/1152/44
In my index.php file ,i tried using $userid = $_REQUEST['userid'];
but im not getting the request value in php file
Upvotes: 0
Views: 782
Reputation: 4711
you should do something like this:
Route::get('payumoneypayment/{courseid}/{userid}', function($courseid, $userid) {
return view('payumoneypayment', [
'courseid' => $courseid,
'userid' => $userid,
]);
});
After that, in your payumoneypayment view (file payumoneypayment.blade.php
):
<?php
include_once(app_path() . '/payu/index.php');
And you will have the variables $courseid
and $userid
usable in your index.php
file.
P.S. its not a good practice use include_once
in a blade template file, just use its syntax (@include
directive).
Upvotes: 1