aboutsummaryrefslogtreecommitdiffhomepage
path: root/api/Users/Requests/CreateUserRequest.php
diff options
context:
space:
mode:
Diffstat (limited to 'api/Users/Requests/CreateUserRequest.php')
-rw-r--r--api/Users/Requests/CreateUserRequest.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/api/Users/Requests/CreateUserRequest.php b/api/Users/Requests/CreateUserRequest.php
new file mode 100644
index 0000000..c168eb2
--- /dev/null
+++ b/api/Users/Requests/CreateUserRequest.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace Api\Users\Requests;
+
+use Infrastructure\Http\ApiRequest;
+
+class CreateUserRequest extends ApiRequest
+{
+ public function authorize()
+ {
+ return true;
+ }
+
+ public function rules()
+ {
+ return [
+ 'user' => 'array|required',
+ 'user.email' => 'required|email',
+ 'user.name' => 'required|string',
+ 'user.password' => 'required|string|min:8'
+ ];
+ }
+
+ public function attributes()
+ {
+ return [
+ 'user.email' => 'the user\'s email'
+ ];
+ }
+}