Build a RESTFUL API with SlimPHP

Поделиться
HTML-код
  • Опубликовано: 24 янв 2025

Комментарии • 38

  • @michaels8336
    @michaels8336 Год назад +5

    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.

  • @loveluclins
    @loveluclins 2 года назад +7

    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.

  • @TheOlimper
    @TheOlimper Год назад +2

    It's a great job! Thank you, Tyler!
    I was looking for the proper tutorial and thanks to God I've found yours!

  • @ertugrulyilmaz5090
    @ertugrulyilmaz5090 Год назад +1

    It was short, simple and enough to understand. Thank you so much Tyler.

  • @bacon37460
    @bacon37460 2 года назад +1

    Great tutorial, thanks! You have the same voice as Shaun of "The Net Ninja" channel.

  • @zzzbyyy
    @zzzbyyy Год назад

    thanks so much I wanted to try this Slim in my app ... and this tutorial is perfect starter for me.

  • @dstudio1011
    @dstudio1011 2 года назад +2

    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.

  • @abdulrahmannasser1979
    @abdulrahmannasser1979 2 года назад +2

    Thank you so much for this clear and precious Explanation.

  • @mikeeomega
    @mikeeomega 3 года назад +2

    Thanks I just had doubts about making a simple API with Slimm instead of with lumen

  • @modestusmunh93
    @modestusmunh93 2 года назад +1

    Great vid! Thanks Tyler!

  • @Rockyfelix993
    @Rockyfelix993 3 года назад +1

    it doesn't work using router "require" on my part... Is this video for slim3 or slim4?

  • @0Apostata0
    @0Apostata0 2 года назад +1

    what about put?

  • @RendyWijaya
    @RendyWijaya 3 года назад +7

    i got an error : Uncaught Slim\Exception\HttpNotFoundException: Not found.

    • @patrickwallin3512
      @patrickwallin3512 3 года назад

      I got that same error too.

    • @TheAhmet1996
      @TheAhmet1996 3 года назад

      You guys got a solution for this?

    • @Aqrza
      @Aqrza 3 года назад +1

      Try to change your directory like this.
      $app->get('/project-folder/public/', function (Request $request, Response $response) {
      $response->getBody()->write("Hello, World!");
      return $response;
      });

    • @alfiangoemulya
      @alfiangoemulya 2 года назад

      @@Aqrza thanks

  • @neno7627
    @neno7627 Год назад

    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?

  • @joelpww
    @joelpww 2 года назад

    Super useful walk-through and tutorial

  • @luiseduardobeltranheras6313
    @luiseduardobeltranheras6313 2 года назад +1

    Simply and easy , thanks alot.

  • @kerolosghobreyal9189
    @kerolosghobreyal9189 2 года назад

    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?

    • @dstudio1011
      @dstudio1011 2 года назад

      I think new data was described around the code $app->post ----

  • @itismadebymonkey
    @itismadebymonkey Год назад

    This is not Tyler, this is Judo Sloth due to his speech manner)

  • @chrisdedavid1860
    @chrisdedavid1860 Год назад

    Authentication?

  • @Razvanh29
    @Razvanh29 3 года назад

    Is there a reason why there are no controllers in this app?

  • @baul9146
    @baul9146 3 года назад +2

    The hosting u promoted is expensive af

    • @TylerPotts
      @TylerPotts  3 года назад

      I'm currently using it myself, although it is more expensive than its competition it offers great managed hosting on a cloud platform.

  • @andreaseisermann1045
    @andreaseisermann1045 3 года назад

    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.

    • @TylerPotts
      @TylerPotts  3 года назад

      Thanks, Andreas. If you need more help feel free to join my discord and ask for help in the channels :D

  • @theseb3845
    @theseb3845 2 года назад

    I watched the start of the video. I liked it.
    Then I saw blank requires instead of PSR autoloading and it kinda flattened.

  • @hakkicengiz
    @hakkicengiz 3 года назад

    Thanks

  • @raphaelrinkin815
    @raphaelrinkin815 Год назад

    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.

  • @jecajSudbine
    @jecajSudbine Год назад +1

    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.