Lumen Programming Guide: Writing PHP Microservices, REST and Web Service APIs
暫譯: Lumen 程式設計指南:撰寫 PHP 微服務、REST 及 Web 服務 API
Paul Redmond
- 出版商: Apress
- 出版日期: 2016-09-24
- 售價: $2,230
- 貴賓價: 9.5 折 $2,119
- 語言: 英文
- 頁數: 247
- ISBN: 1484221869
- ISBN-13: 9781484221860
-
相關分類:
Microservices 微服務、SOA、PHP
海外代購書籍(需單獨結帳)
商品描述
Learn to write test-driven microservices, REST APIs, and web service APIs with PHP using the Lumen micro-framework, from the now popular Laravel family. This book shows you how testing APIs can help you write bullet-proof web application services and microservices.
In the Lumen Programming Guide you will learn how to use Lumen—a micro-framework by Laravel—to write bullet-proof APIs. Lumen helps you write productive, maintainable APIs using modern application design. You will learn how to write fully-tested APIs and understand essential Lumen concepts used to build a solid foundation for writing API projects.
What You Will Learn
- Maintain your API's database structure through built-in database migrations
- Write tests with factory data in a test database
- Respond with consistent data output in JSON
- Deal with PHP exceptions by using JSON responses
- Create, read, update, and delete REST resources
- Represent model associations in API responses
- Build a solid foundation for writing tests with PHPUnit and Mockery
- Validate data
Who This Book Is For
PHP developers with no Laravel experience. Only a basic understanding of HTTP and writing PHP applications is needed to get started.
商品描述(中文翻譯)
學習如何使用 Lumen 微框架(來自現在流行的 Laravel 家族)編寫測試驅動的微服務、REST API 和網路服務 API。本書展示了測試 API 如何幫助您編寫堅如磐石的網路應用服務和微服務。
在《Lumen 程式設計指南》中,您將學習如何使用 Lumen——Laravel 的微框架——來編寫堅如磐石的 API。Lumen 幫助您使用現代應用設計編寫高效且可維護的 API。您將學習如何編寫完全測試的 API,並理解用於建立 API 專案堅實基礎的基本 Lumen 概念。
您將學到的內容:
- 通過內建的資料庫遷移維護您的 API 資料庫結構
- 在測試資料庫中使用工廠數據編寫測試
- 以一致的 JSON 數據輸出作為回應
- 通過使用 JSON 回應處理 PHP 異常
- 創建、讀取、更新和刪除 REST 資源
- 在 API 回應中表示模型關聯
- 為使用 PHPUnit 和 Mockery 編寫測試建立堅實基礎
- 驗證數據
本書適合對象:
對 Laravel 沒有經驗的 PHP 開發者。只需對 HTTP 和編寫 PHP 應用有基本了解即可開始。