|
@@ -0,0 +1,41 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace Modules\Manage\Http\Requests;
|
|
|
+
|
|
|
+use Illuminate\Foundation\Http\FormRequest;
|
|
|
+use Modules\Manage\Enmus\MiniprogramType;
|
|
|
+use Illuminate\Validation\Rule;
|
|
|
+
|
|
|
+class MiniprogramUpdateRequest extends FormRequest
|
|
|
+{
|
|
|
+ /**
|
|
|
+ * Determine if the user is authorized to make this request.
|
|
|
+ */
|
|
|
+ public function authorize(): bool
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get the validation rules that apply to the request.
|
|
|
+ *
|
|
|
+ * @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
|
|
+ */
|
|
|
+ public function rules(): array
|
|
|
+ {
|
|
|
+ return [
|
|
|
+ 'name'=> 'required|max:50',
|
|
|
+ 'play_name'=> 'required|max:100',
|
|
|
+ 'company'=> 'required|max:255',
|
|
|
+ 'type'=> [
|
|
|
+ 'required',
|
|
|
+ Rule::in( array_map( fn($item)=>$item->value(),MiniprogramType::cases())),
|
|
|
+ ],
|
|
|
+ 'appsecret'=>'required|min:30',
|
|
|
+ 'appid'=>'required|min:18',
|
|
|
+ 'status'=>'in:0,1'
|
|
|
+ ];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|