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:
755 bytes
|
Rev | Line | |
---|
[0924b6c] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | namespace App\Http\Requests\Dashboard;
|
---|
| 4 |
|
---|
| 5 | use Illuminate\Foundation\Http\FormRequest;
|
---|
| 6 | use Illuminate\Support\Facades\Auth;
|
---|
| 7 | use Illuminate\Validation\Rule;
|
---|
| 8 |
|
---|
| 9 | class TransferPostsSettingsRequest extends FormRequest
|
---|
| 10 | {
|
---|
| 11 | /**
|
---|
| 12 | * Determine if the user is authorized to make this request.
|
---|
| 13 | *
|
---|
| 14 | * @return bool
|
---|
| 15 | */
|
---|
| 16 | public function authorize()
|
---|
| 17 | {
|
---|
| 18 | return true;
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | /**
|
---|
| 22 | * Get the validation rules that apply to the request.
|
---|
| 23 | *
|
---|
| 24 | * @return array
|
---|
| 25 | */
|
---|
| 26 | public function rules()
|
---|
| 27 | {
|
---|
| 28 | return [
|
---|
| 29 | "from" => "required|exists:users,id",
|
---|
| 30 | "to" => [
|
---|
| 31 | Rule::requiredIf(auth()->user()->post->count() > 0),
|
---|
| 32 | "exists:users,id"
|
---|
| 33 | ],
|
---|
| 34 | ];
|
---|
| 35 | }
|
---|
| 36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.