11<?php
22
3-
43namespace Studio \Totem \Http \Requests ;
54
65use Illuminate \Foundation \Http \FormRequest ;
7- use Illuminate \Http \Exceptions \HttpResponseException ;
8- use Illuminate \Http \UploadedFile ;
96use Illuminate \Contracts \Validation \Validator ;
7+ use Illuminate \Http \Exceptions \HttpResponseException ;
108
119class ImportRequest extends FormRequest
1210{
@@ -19,6 +17,7 @@ public function authorize()
1917 {
2018 return true ;
2119 }
20+
2221 /**
2322 * Get the validation rules that apply to the request.
2423 *
@@ -28,7 +27,7 @@ public function rules()
2827 {
2928 return [
3029 'tasks ' => 'required|file|jsonFile ' ,
31- 'content ' => 'json '
30+ 'content ' => 'json ' ,
3231 ];
3332 }
3433
@@ -43,7 +42,7 @@ public function messages()
4342 'tasks.required ' => 'Please select a file to import ' ,
4443 'tasks.file ' => 'Please select a file to import ' ,
4544 'tasks.json_file ' => 'Please select a json file ' ,
46- 'content ' => 'File does not contain valid json '
45+ 'content ' => 'File does not contain valid json ' ,
4746 ];
4847 }
4948
@@ -56,7 +55,7 @@ public function messages()
5655 */
5756 public function all ($ keys = null )
5857 {
59- $ content = "" ;
58+ $ content = '' ;
6059
6160 if ($ jsonFile = $ this ->file ('tasks ' )) {
6261 $ content = $ jsonFile ->get ();
@@ -73,7 +72,7 @@ public function all($keys = null)
7372 */
7473 public function validated ()
7574 {
76- $ content = "" ;
75+ $ content = '' ;
7776
7877 if ($ jsonFile = $ this ->file ('tasks ' )) {
7978 $ content = $ jsonFile ->get ();
@@ -82,7 +81,6 @@ public function validated()
8281 return array_merge (parent ::validated (), compact ('content ' ));
8382 }
8483
85-
8684 /**
8785 * * Handle a failed validation attempt.
8886 *
@@ -92,4 +90,4 @@ protected function failedValidation(Validator $validator)
9290 {
9391 throw new HttpResponseException (response ()->json ($ validator ->errors (), 422 ));
9492 }
95- }
93+ }
0 commit comments