aboutsummaryrefslogtreecommitdiffhomepage
path: root/api/Posts/Requests/CreatePostRequest.php
diff options
context:
space:
mode:
authorMarvin Borner2018-08-24 13:17:32 +0200
committerMarvin Borner2018-08-24 13:17:32 +0200
commit0ee38e98532a9daf7ba08ab65b7f73d6505e0aea (patch)
tree6ff916179bb4ebe14369ea99b84109dc6e52ba13 /api/Posts/Requests/CreatePostRequest.php
parent3045cb39be8b9c9cb3ca6ed643ccceac0042f0c0 (diff)
Began API for posts
Diffstat (limited to 'api/Posts/Requests/CreatePostRequest.php')
-rw-r--r--api/Posts/Requests/CreatePostRequest.php30
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'
+ ];
+ }
+}