Last change
on this file since f457265 was 0924b6c, checked in by Özkan İliyaz <iliyaz_96@…>, 4 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
932 bytes
|
Rev | Line | |
---|
[0924b6c] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | namespace App\Http\Requests\Auth;
|
---|
| 4 |
|
---|
| 5 | use Illuminate\Foundation\Http\FormRequest;
|
---|
| 6 | use Illuminate\Validation\Rule;
|
---|
| 7 |
|
---|
| 8 | class CreatePasswordRequest extends FormRequest
|
---|
| 9 | {
|
---|
| 10 | /**
|
---|
| 11 | * Determine if the user is authorized to make this request.
|
---|
| 12 | *
|
---|
| 13 | * @return bool
|
---|
| 14 | */
|
---|
| 15 | public function authorize()
|
---|
| 16 | {
|
---|
| 17 | return true;
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | /**
|
---|
| 21 | * Get the validation rules that apply to the request.
|
---|
| 22 | *
|
---|
| 23 | * @return array
|
---|
| 24 | */
|
---|
| 25 | public function rules()
|
---|
| 26 | {
|
---|
| 27 | $that = $this;
|
---|
| 28 |
|
---|
| 29 | return [
|
---|
| 30 | "password" => "required|string|confirmed|min:8|regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/",
|
---|
| 31 | "security_code" => [
|
---|
| 32 | "required",
|
---|
| 33 | "integer",
|
---|
| 34 | Rule::exists("users")->where(function ($query) use ($that) {
|
---|
| 35 | $query->where("id", $that->route("id"));
|
---|
| 36 | }),
|
---|
| 37 | ]
|
---|
| 38 | ];
|
---|
| 39 | }
|
---|
| 40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.