How to set up routing for a php api script create.php?

22
March 16, 2019, at 00:00 AM

I'm trying to setup an url in my laravel project from which my database can receive post requests, i have this script i made in php and i put in /public folder, it works fine when hosted in xampp but when i put it in my laravel project i get a not found error this is what my php script looks like

api-receive-alert is under /public in my laravel project

this is the routing for it in web.php

Route::post('/receivealert', 'api-receive-alert/api/historique/create.php');
Answer 1

You need to refactor you code. You cant move an existing project into a laravel instance and its working directly.

But when your code is in the public directory, you don't need to create an route for this. But its better to move this code to laravel.

READ ALSO
How to provide website statistics for page visits? [on hold]

How to provide website statistics for page visits? [on hold]

I have a website written in php and mysql, the website also have an admin panel for user interfaceIs there any quick and easy way to provide a website statistics in admin panel?

38
Display selected BACS account from matching order item meta value using Woocommerce hooks

Display selected BACS account from matching order item meta value using Woocommerce hooks

Based on "Select BACS account to show in thankyou page in WooCommerce" answer code to one of my questions, I have changed the Woocommerce core file "class-wc-gateway-bacsphp" In order to select the correct bank account displayed on thankyou page, that matches...

46
SQL: How do I filter (WHERE) a joined (ON) table in SQL?

SQL: How do I filter (WHERE) a joined (ON) table in SQL?

I have two tables (users and posts) and I want to write out all posts (among other things) by one userI'm thinking I should use a JOIN and WHERE but I get an error for using WHERE

18
Why SQLSTATE[HY000] [2002] No such file or directory Magento

Why SQLSTATE[HY000] [2002] No such file or directory Magento

When I run php bin/magento install:setup I received this error:

23