Aug 1, 2021
0
Level 1
Getting Post data from elementor form to Laravel
Greetings Laracast ππββοΈ, got a nice issue hereπ .
Using WordPress Elementor Form I want to post the data of the fields to the post URL that I am using with Laravel.
Using Postman server I am able to see the value of the fields If I put the Postman URL:
[This is from the Elementor API form]
*Postman URL*
|
v
wp_remote_post( 'https://02e725e6-e8ec-452a-a667-58d2c3dd2b26.mock.pstmn.io', [
'body'=> $body,
'method' => 'POST',
]);
To see if it worked with Laravel I change the URL to the POST Laravel one:
wp_remote_post( 'http://localhost:8000/uploadfileinfo', [
'body'=> $body,
'method' => 'POST',
]);
I also added a exception to the CsrfToken middleware of the URL I am receiving the data:
class VerifyCsrfToken extends Middleware
{
/**
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
*
* @var bool
*/
protected $addHttpCookie = true;
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
//
'https://staging.form.com/*',
];
}
But nothing seems to work, I'm in a lostπ.
If you guys have any tips Ill appreciate it.
Thanks in advance.
Please or to participate in this conversation.