
Learn to design a real-world PHP API with Apigility, from installation and dependency management to core functionality, using domain-driven design, user management, unit testing, and Doctrine ORM.
This video will cover the installation of Zend Studio and the creation of our Apigility project inside of Zend Studio.
Learn to manage PHP project dependencies with Composer, install and update the Doctrine ORM module for Zend Framework 2, and understand composer.json, composer.lock, and the vendor folder.
Instead of using the vagrant process for setting up the development environment, I'd suggest reviewing Lecture 5, UPDATE - Docker Container support. This is a more modern approach to setting up local development environments. The prerequisites for that include downloading docker for your operating system and ensuring you have docker-compose in your PATH. Each operating system varies on this process.
Configure Doctrine in a Zend Framework app by installing the Doctrine ORM module, merging driver and connection settings, and defining an annotated user entity to map to the users table.
Configure the ZF off to doctrine module to enable doctrine-generated entities for Apigility. Update composer and run schema tool updates to sync the database with mapping.
Explore dependency injection, including constructor and setter injections, with hard and optional dependencies like the entity manager; learn how dependency injection boosts testability by swapping implementations.
Learn how factories and services in Zend Framework 2 wire dependencies via the service manager and service locator, injecting the Doctrine entity manager into the user service.
Apply separation of concerns by dividing the project into module a for app agility controller and module b for business functionality to improve testability, future proofing, and support domain model.
Create a domain model by organizing a user entity under a new my company module, configure Doctrine, and implement a user service interface and factory, with tests, for Apigility integration.
Configure PHPUnit in scotch box for the my company module, creating a bootstrap, testing services with a service manager, and generating code coverage; practice test‑driven development through unit tests.
Implement a user registration service in a PHP Apigility project, checking for existing users and creating new ones with email and password, throwing a runtime exception if already registered.
Set up a repeatable unit test for user registration in PHP using Apigility, including configuring the object relational manager and cleaning up test users by email.
Add sending of a welcome email to the user service by integrating slim mail and aws ses, generating activation tokens, and rendering a templated activation link.
Implement forgot password and reset password flows in the user service by hashing passwords with a crypt algorithm at cost 14, wiring email notifications, tests, and interface updates.
Explore implementing forgot password and reset password in a PHP Apigility API, including token handling, email flow, and user fetch, all driven by unit tests and code coverage.
Address the deprecated warning in a PHP Apigility project by disabling user deprecated error reporting and restarting Apache, while preparing updates to ZF auth with Doctrine mapper.
Build a real-world user registration flow with Apigility by creating an identity API, exposing a post endpoint for registration, validating email and password, and handling errors with an API problem.
Link the forgot password step to the rest api by exposing account/begin password reset with an email address validation and no authorization, initiating the password reset flow.
Create a password reset landing page by defining the reset controller and route in a PHP Apigility app. Implement a front-end form with token, email, and password validation.
Learn how to build a robust API for your projects using the actively developed and frequently contributed to API framework, Apigility. This course is designed to jumpstart your API development and clear up many of the potentially confusing parts on how to get started using Apigility.
At the end of this course you will have a working API that provides user registration, forgotten password resets, and email notifications. You will gain some working experience with Doctrine ORM and oauth2. Finally, you'll be confident that your API's backing logic will reliably perform how you expect it to because your domain models will be unit tested.