Build a RESTFUL API with SlimPHP

Поделиться
HTML-код
  • Опубликовано: 4 мар 2021
  • Learn how to create an API with SLIM PHP!
    PHP Hosting: www.cloudways.com/en/php-host...
    Cloudways offers peace of mind and flexibility so you can focus on growing your business and reaching new milestones instead of dealing with server management. With Cloudways, you get an optimized stack, managed servers, backups, staging environment, integrated Git, pre-configured, Composer, 24/7 support, and the choice of five cloud providers: AWS, DigitalOcean, Linode, Google Cloud, and Vultr
    Get up to 1 Month Free Hosting by using code "TYLERP" and get $15 free hosting credit.
    // Support me on Ko-Fi
    ko-fi.com/tylerpotts
    // FOLLOW ME ON TWITTER
    / tyler_potts_
    // MY GEAR FOR CODING AND RUclips
    Blue Yeti Microphone: amzn.to/3jr3l7T
    Microphone Stand: amzn.to/35B9LMN
    Chair: amzn.to/3dWds3F
    Thunderbolt Dock: amzn.to/3osBF6u
    Monitor: amzn.to/37I8KoR
    All of these products I own and have tested!
    // INTERESTED IN GAME DEV?
    Game development channel: / muddywolf
    // CHECK OUT MY GAME
    play.google.com/store/apps/de...
    // DO THESE SIMPLE STEPS
    LIKE, SUBSCRIBE & SHARE
  • ХоббиХобби

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

  • @michaels8336
    @michaels8336 8 месяцев назад +3

    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.

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

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

  • @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!

  • @zzzbyyy
    @zzzbyyy 10 месяцев назад

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

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

    Thank you so much for this clear and precious Explanation.

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

    Super useful walk-through and tutorial

  • @dstudio1011
    @dstudio1011 Год назад +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.

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

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

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

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

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

    Great vid! Thanks Tyler!

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

    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.

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

    Simply and easy , thanks alot.

  • @neno7627
    @neno7627 8 месяцев назад

    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?

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

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

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

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

  • @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 Год назад

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

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

    Thanks

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

    what about put?

  • @chrisdedavid1860
    @chrisdedavid1860 5 месяцев назад

    Authentication?

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

    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  2 года назад

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

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

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

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

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

  • @raphaelrinkin815
    @raphaelrinkin815 9 месяцев назад

    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.

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

    The hosting u promoted is expensive af

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

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

  • @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 2 года назад

      You guys got a solution for this?

    • @Aqrza
      @Aqrza 2 года назад +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 Год назад

      @@Aqrza thanks

  • @amigaworkbench720
    @amigaworkbench720 4 месяца назад +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.