diff options
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' + ]; + } +} |