diff --git a/readme.md b/readme.md index 3b55e7e..6e32c69 100644 --- a/readme.md +++ b/readme.md @@ -40,10 +40,10 @@ Add the trait use acidjazz\metapi\MetApi; class Controller { - use Metapi; + use Metapi; ``` -## Examples +## Examples ```php option('contact.email', 'required|email', [], 'Email Address') + ->option('contact.name', 'required|string', [], 'Firstname') + ->option('contact.surname', 'required|string', [], 'Lastname') + ->verify(); + ... + $this->render($results); + } +``` + +`POST /send` + +```json +{ + "status": "error", + "errors": [ + { + "status": 400, + "message": "contact.email", + "detail": "Email Address is a required field." + }, + { + "status": 400, + "message": "contact.name", + "detail": "Firstname is a required field." + }, + { + "status": 400, + "message": "contact.surname", + "detail": "Lastname is a required field." + } + ] +} +```