Changeset c6b84df for app/Http/Requests
- Timestamp:
- 10/21/21 23:45:59 (3 years ago)
- Branches:
- develop, master
- Children:
- 4b7e2d3
- Parents:
- 6b95845
- Location:
- app/Http/Requests/Dashboard
- Files:
-
- 3 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Requests/Dashboard/FileRequest.php
r6b95845 rc6b84df 3 3 namespace App\Http\Requests\Dashboard; 4 4 5 use App\Helpers\Alert; 6 use App\Models\FileType; 7 use App\Rules\UploadCount; 5 8 use Illuminate\Foundation\Http\FormRequest; 6 9 … … 24 27 public function rules() 25 28 { 26 return [ 27 "name" => "required|max:255|regex:/^[^.]+$/", 28 ]; 29 $rules = [ 30 "folder" => "required|integer|exists:folders,id", 31 ]; 32 33 $mimes = FileType::find("1")->mimes; 34 $maxSize = FileType::find("1")->max_size; 35 36 if ($this->isMethod("patch")) { 37 $fileRules = [ 38 "file_item.*" => "mimes:{$mimes}|max:{$maxSize}" 39 ]; 40 } 41 42 else { 43 $fileRules = [ 44 "file_item.*" => "mimes:{$mimes}|max:{$maxSize}" 45 ]; 46 } 47 48 $rules = array_merge( 49 $rules, 50 $fileRules, 51 ); 52 53 return $rules; 29 54 } 30 55 } -
app/Http/Requests/Dashboard/NewUserRequest.php
r6b95845 rc6b84df 29 29 "phone_number" => "required|unique:users,phone_number", 30 30 "email" => "required|string|email|max:50|unique:users,email", 31 "username" => "required| min:5|max:30|unique:users,username",31 "username" => "required|alpha_dash|min:5|unique:users,username", 32 32 "userRole" => "required|exists:roles,id", 33 "avatar" => " mimes:jpeg,png,gif|max:5000",33 "avatar" => "image|max:5000", 34 34 ]; 35 35 } -
app/Http/Requests/Dashboard/UpdateUserRequest.php
r6b95845 rc6b84df 29 29 "phone_number" => "required|unique:users,phone_number,$this->id,id", 30 30 "email" => "required|string|email|max:50|unique:users,email,$this->id,id", 31 "username" => "required| min:5|unique:users,username,$this->id,id",31 "username" => "required|alpha_dash|min:5|unique:users,username,$this->id,id", 32 32 "userRole" => "required|exists:roles,id", 33 33 "avatar" => "mimes:jpeg,png,gif|max:5000",
Note:
See TracChangeset
for help on using the changeset viewer.