Update handler middleware in Zend Expressive PHP REST API - 011
We make an Update handler in a Zend Expressive application for a PHP REST API project using Doctrine ORM in PhpStorm. (see shortcuts below to key points) Adam Culp of Beachcasts php videos creates a new update handler to satisfy PUT HTTP requests to a REST API written in PHP using a php framework. Later we will be introducing Zend Framework (Laminas Project) components, as well as components from other projects. Next video in the series: https://youtu.be/3nLbQfMk99k It is part of the playlist: https://www.youtube.com/playlist?list=PL6_nF0awZMoMol4RPLf99WIZuoJ3l87oG For a nice list of equipment I use in my studio, and to support the channel if you make any purchases (doesn't cost you a thing), visit my kit at kit.co: https://kit.co/beachcasts/beachcasts-studio Please * LIKE, COMMENT, AND SUBSCRIBE * - and share with others! Key Topics: - Using the Expressive CLI toolkit component - Automate Hypermedia creation - Leverage Doctrine ORM Paginator for HAL creation NOTE: This video does not include data verification or validation, which should be included in all applications. That will be added in future videos. Errata: Let me know if you notice anything that should be errata Code used in this, and in future videos of this series is located at: https://github.com/Beachcasts/doctrine-expressive-example Associated Links: https://docs.zendframework.com/zend-expressive/ - Site for Zend Expressive https://getexpressive.org/ - Expressive main site https://getlaminas.org/ - Laminas Project site Timeline: 00:00 Video Intro 02:03 PhpStorm Scratches explained 02:23 Breachdown of a PUT scratch in PhpStorm 03:20 Call through Composer to Expressive Tooling 03:45 Use Expressive Tooling to create a new Handler in terminal 05:04 Show where Expressive Tooling creates Config items 07:18 We look at the new factory created for the update handler 08:15 Make changes to the factory to inject needed objects to the handler 09:55 We look at the Update handler 10:15 Create fields we expect to be injected into the handler 11:26 Create the contructor to properly assign the field values from injection 13:56 Gain access to the response body of the PUT request 15:25 How to validate the request has a body 17:00 Gain access to the Entity Repository 18:00 Query the database for the record to update 18:45 Validate the record exists in the database or error out as needed 19:23 Explanation of object setter to populate the record 19:50 Code to perform the update 22:00 Create the response after the record has been update 23:18 Use the database panel in PhpStorm 24:00 Explain the PhpStorm scratch to update a record 24:30 Execute the request using the PhpStorm scratch file Other Beachcasts PHP tech videos you might find interesting: Critical programming issues preventing a PHP 7 upgrade https://youtu.be/z13glyDnm6s Behat for beginners functional REST API testing tutorial https://youtu.be/nFNGDhyFrm4 Doctrine ORM one-to-many bi-directional association https://youtu.be/4nEdBDxBc1w PHP Mess Detector static analysis to find PHP code smells https://youtu.be/8fEfHESrK5E Doctrine ORM one-to-many self-referencing association https://youtu.be/4dHZ6cZooOk 10 reasons to become a consultant in a consulting business https://youtu.be/J7gpMYAKmDM Zend Framework becomes Laminas project at Linux Foundation https://youtu.be/CEIO90ocEDI 10 bad things about consulting https://youtu.be/ELE0G3e7h3c How to get lines of code in PHP https://youtu.be/HpC-Cvxj6oY Make a List handler middleware https://youtu.be/VLqavHCFv6g Use UUID with Doctrine ORM for DB keys https://youtu.be/SYuLwMwSIpg Make a Create handler middlware https://youtu.be/FIYh-VIWUko Automate Hypermedia creation for PHP REST API https://youtu.be/dX6S-pJVUXI Learn about Hypermedia and how to create it https://youtu.be/aV6ro_JXL_A Doctrine ORM Paginator for PHP REST API https://youtu.be/UpqOew4sNT0 Doctrine ORM Entity how to https://youtu.be/NnK9Geg1h_E Configure Doctrine ORM https://youtu.be/pFvh5ZNhdOQ Create PHP middlware with Zend Expressive https://youtu.be/26440j7D0BE Configure PhpStorm for PHP development with Docker https://youtu.be/FQWL-JTZvf4 Create PHP development environment with docker https://youtu.be/2ESAi2vq-80 Help through referrals: Thinking of buying a Tesla electric vehicle? Use this referral link to also get six months of free Supercharging for both of us. Thank you. https://www.tesla.com/referral/tanya21367 I use TubeBuddy to help me manage my YouTube channel. If you're interested, click the following link to check it out. https://www.tubebuddy.com/beachcasts #DoctrineORM #ZendExpressive #Beachcasts
Download
0 formatsNo download links available.