O'Reilly logo

Lumen Programming Guide: Writing PHP Microservices, REST and Web Service APIs by Paul Redmond

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Paul Redmond 2016

Paul Redmond, Lumen Programming Guide, 10.1007/978-1-4842-2187-7_8

8. Validation

Paul Redmond

(1)Phoenix, Arizona, USA

Your /books API is going smoothly up to this point, but your tests and controllers assume that good data is being submitted. Your application doesn’t protect against bad data (and empty data) being saved to the database; specifically, the BooksController@store and BooksController@update methods happily save bad data.

You will focus your efforts on validating data submitted to the /books API using the validation ( https://lumen.laravel.com/docs/5.2/validation ) tools provided by Lumen. You will write tests for your validation logic; this will provide you with a good foundation of how write validation tests in your ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required