Issues here with SQL injection, please use bind params anytime you need to pass anything into the SQL statement. Also REST does not use RPC, it has routes which uses the HTTP method to determine the function, e.g. POST /friends rather than POST /friends/add.
Microframeworks are great, some developers don't even know how to write a database query nowadays, and then no one knows how to fix it if something goes wrong.
Hi Tyler, great video. Learned more about REST API and using Slim to develop them. I would like to know what's next step/phase....I'm thinking of how to clean inputs and also inlcude authentication/authorization in using the api. Any recommendation where I can learn these? Thanks again.
Try to change your directory like this. $app->get('/project-folder/public/', function (Request $request, Response $response) { $response->getBody()->write("Hello, World!"); return $response; });
In index.php I have multiple require __DIR__ ./../routes/filename.php But always only the last one works. Is there a solution to multiple API endpoints?
This was a useful video, Tyler. Thanks! i got an error by request localhost/name You don't have permission to access this resource. # i hav not middleware activated . the first Request localhost/ work fine.
Hi @tylerPotts. Thanks for this vidéo. I'm trying to make this work on SLIM4. It works fo-ine for the 2x GET and DELETE. Unfortunately the POST isn't working. Array pushed to the DB is always NULL. When making a var_dump of the $request, array is simply NULL. As a consequence, it creates the line in the DB but content is called "ARRAY". Any idea.
Issues here with SQL injection, please use bind params anytime you need to pass anything into the SQL statement. Also REST does not use RPC, it has routes which uses the HTTP method to determine the function, e.g. POST /friends rather than POST /friends/add.
Microframeworks are great, some developers don't even know how to write a database query nowadays, and then no one knows how to fix it if something goes wrong.
It's a great job! Thank you, Tyler!
I was looking for the proper tutorial and thanks to God I've found yours!
Glad I could help!
It was short, simple and enough to understand. Thank you so much Tyler.
Great tutorial, thanks! You have the same voice as Shaun of "The Net Ninja" channel.
thanks so much I wanted to try this Slim in my app ... and this tutorial is perfect starter for me.
Hi Tyler, great video. Learned more about REST API and using Slim to develop them. I would like to know what's next step/phase....I'm thinking of how to clean inputs and also inlcude authentication/authorization in using the api. Any recommendation where I can learn these?
Thanks again.
Thank you so much for this clear and precious Explanation.
You're very welcome!
Thanks I just had doubts about making a simple API with Slimm instead of with lumen
Great vid! Thanks Tyler!
Glad you liked it!
it doesn't work using router "require" on my part... Is this video for slim3 or slim4?
what about put?
i got an error : Uncaught Slim\Exception\HttpNotFoundException: Not found.
I got that same error too.
You guys got a solution for this?
Try to change your directory like this.
$app->get('/project-folder/public/', function (Request $request, Response $response) {
$response->getBody()->write("Hello, World!");
return $response;
});
@@Aqrza thanks
In index.php I have multiple require __DIR__ ./../routes/filename.php
But always only the last one works. Is there a solution to multiple API endpoints?
Super useful walk-through and tutorial
Simply and easy , thanks alot.
You are welcome 😊
Thanks for the tutorial!.. I just had a question.. what if I wanted to put new data or update the data that is in the database?
I think new data was described around the code $app->post ----
This is not Tyler, this is Judo Sloth due to his speech manner)
Authentication?
Is there a reason why there are no controllers in this app?
The hosting u promoted is expensive af
I'm currently using it myself, although it is more expensive than its competition it offers great managed hosting on a cloud platform.
This was a useful video, Tyler. Thanks!
i got an error by request localhost/name
You don't have permission to access this resource. # i hav not middleware activated .
the first Request localhost/ work fine.
Thanks, Andreas. If you need more help feel free to join my discord and ask for help in the channels :D
I watched the start of the video. I liked it.
Then I saw blank requires instead of PSR autoloading and it kinda flattened.
Thanks
Hi @tylerPotts. Thanks for this vidéo. I'm trying to make this work on SLIM4. It works fo-ine for the 2x GET and DELETE. Unfortunately the POST isn't working. Array pushed to the DB is always NULL. When making a var_dump of the $request, array is simply NULL. As a consequence, it creates the line in the DB but content is called "ARRAY". Any idea.
Wow, the documentation for this is so poor that not even ChatGPT can help me. I'm sorry, but I'm uncertain if this project can be taken seriously.