Automate Hypermedia PHP REST API with Doctrine ORM – 008

HomeOther Content, TechAutomate Hypermedia PHP REST API with Doctrine ORM – 008
Automate Hypermedia PHP REST API with Doctrine ORM - 008
Automate Hypermedia PHP REST API with Doctrine ORM – 008
Automate Hypermedia (HAL) for a PHP REST API in a Zend Expressive PHP project with Doctrine ORM. Includes adding pagination related links to web development. This method could be used for any PSR-7 PHP application. (see shortcuts below to key points) Adam Culp of Beachcasts php videos shows how to automate hypermedia creation using the expressive-hal component.

Later we will be introducing Zend Framework (Laminas Project) components, as well as components from other projects.

Next video in the series:
It is part of the playlist:

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

Key Topics:
– Using Expressive HAL component
– Automate Hypermedia creation
– Leverage Doctrine ORM Paginator for HAL creation

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

Technically, the AnnouncementsCollection is not an entity.
17.39 The use of route in the getHalMetadataMap() function is not for routing, and is instead what is used to generate URLs in HAL.

Code used in this, and in future videos in this series is located at:

Associated Links: – Site for Zend Expressive – Zend Expressive HAL Component – Automated HAL creation for Doctrine Paginator – Expressive main site – Laminas Project site – PhpStorm PHP IDE

00:00 Video Intro
03:46 Execute bash inside Docker container
05:18 Composer require the zend-expressive-hal package
07:42 Composer require zend-hydrator package
08:25 Confirm that ConfigProviders are added to config
10:30 Update route to use pagination as arguments in URL
12:45 Create a collection object extending the Doctrine Paginator
14:10 Update Expressive module ConfigProvider with the MetadataMap for zend-expressive-hal
18:25 Updating the ReadHandlerFactory to create needed HAL generator objects
21:46 Updating the ReadHandler to expect the HAL generator objects injected
24:35 Update the Handle method to create HAL
31:00 Creating the return that will contain the HAL

Other Beachcasts PHP tech videos you might find interesting:
Critical programming issues preventing a PHP 7 upgrade
Behat for beginners functional REST API testing tutorial
Doctrine ORM one-to-many bi-directional association
PHP Mess Detector static analysis to find PHP code smells
Doctrine ORM one-to-many self-referencing association
10 reasons to become a consultant in a consulting business
Zend Framework becomes Laminas project at Linux Foundation
10 bad things about consulting
How to get lines of code in PHP
Make a List handler middleware
Make a Delete handler middleware
Make an Update handler middleware
Use UUID with Doctrine ORM for DB keys
Learn about Hypermedia and how to create it
Doctrine ORM Paginator for PHP REST API
Doctrine ORM Entity how to
Configure Doctrine ORM
Create PHP middlware with Zend Expressive
Configure PhpStorm for PHP development with Docker
Create PHP development environment with docker

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.

I use TubeBuddy to help me manage my YouTube channel. If you’re interested, click the following link to check it out.

Help support Doctrine ORM:

#hypermedia #ZendExpressive #Beachcasts

Take the opportunity to connect and share this video with your friends and family if you find it useful.

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *