diff options
author | Marvin Borner | 2018-08-24 13:17:32 +0200 |
---|---|---|
committer | Marvin Borner | 2018-08-24 13:17:32 +0200 |
commit | 0ee38e98532a9daf7ba08ab65b7f73d6505e0aea (patch) | |
tree | 6ff916179bb4ebe14369ea99b84109dc6e52ba13 /api/Posts/Requests/CreatePostRequest.php | |
parent | 3045cb39be8b9c9cb3ca6ed643ccceac0042f0c0 (diff) |
Began API for posts
Diffstat (limited to 'api/Posts/Requests/CreatePostRequest.php')
-rw-r--r-- | api/Posts/Requests/CreatePostRequest.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/api/Posts/Requests/CreatePostRequest.php b/api/Posts/Requests/CreatePostRequest.php new file mode 100644 index 0000000..be777ac --- /dev/null +++ b/api/Posts/Requests/CreatePostRequest.php @@ -0,0 +1,30 @@ +<?php + +namespace Api\Posts\Requests; + +use Infrastructure\Http\ApiRequest; + +class CreatePostRequest extends ApiRequest +{ + public function authorize() + { + return true; + } + + public function rules() + { + return [ + 'post' => 'array|required', + 'post.email' => 'required|email', + 'post.name' => 'required|string', + 'post.password' => 'required|string|min:8' + ]; + } + + public function attributes() + { + return [ + 'post.email' => 'the post\'s email' + ]; + } +} |