Create PHP middleware with Zend Expressive php framework – 003

テクノロジー



Create PHP middleware with Zend Expressive php framework modules using command line tooling. And create a PHP middleware Handler and the routing needed for it to resolve using FastRoute in our web development project. Then create a RoutesDelegator to handle module specific routes within the module rather than housing routes for the entire application together. (see shortcuts below to key points) Adam Culp of Beachcasts php videos creates a PSR-15 compliant middleware with Zend Expressive 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/pFvh5ZNhdOQ
It is part of the playlist: https://www.youtube.com/playlist?list=PL6_nF0awZMoMol4RPLf99WIZuoJ3l87oG

Please * LIKE, COMMENT, AND SUBSCRIBE * – and share with others!

Key Topics:
– Use the Zend Expressive command line (CLI) tooling
– Create a Zend Expressive module
– Create a Zend Expressive middleware handler
– Create HTTP routes for FastRoute
– Create a Zend Expressive RoutesDelegator to handle routes per module

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

Errata:
Let me know if you notice anything that should be errata

Code used in this, and in future videos in this series is located at: https://github.com/Beachcasts/doctrine-expressive-example

Associated Links:
https://getexpressive.org/ – Main site for Zend Expressive
https://getlaminas.org/ – Laminas Project
https://www.jetbrains.com/phpstorm/ – The PhpStorm site for download and usage documentation
http://php.net/ – Home of the PHP programming language
https://getcomposer.org/ – Site for installing and using Composer with PHP
https://www.docker.com/ – Home of Docker Containers

– Documentation showing how to use Docker Compose

Timeline:
00:00 Video Intro
02:40 Using the Terminal in PhpStorm to launch expressive-tooling via CLI
03:08 How to launch Zend expressive-tooling with PHP
05:03 How to launch Zend expressive-tooling with Composer
05:25 Show how Composer knows about CLI scripts
07:25 Create a module with Zend expressive-tooling
08:20 Show how to create a module ConfigProvider to the Zend Expressive config
08:45 Show how to add an autoload namespace to Composer.json
09:33 Breakdown of ConfigProvider in Zend Expressive
11:23 Show how to add a Handler middleware with Zend expressive tooling
13:55 Breakdown of Zend Expressive Handler Factory and Handler
16:20 Load docker-compose from within PhpStorm
17:15 Add a new route for FastRoute
18:55 Use the HTTP Client in PhpStorm to make REST API calls
20:35 Add a Handler Factory to Zend Expressive
23:20 How to set up a RoutesDelegator to handle Zend Expressive module routes with FastRoute

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
Make a Delete handler middleware https://youtu.be/3nLbQfMk99k
Make an Update handler middleware https://youtu.be/3Zcq5Jjz1Po
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 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

#PhpMiddleware #ZendExpressive #Beachcasts

Comments

Copied title and URL