source: app/Http/Requests/Dashboard/TransferPostsSettingsRequest.php@ ff9da8b

Last change on this file since ff9da8b was 0924b6c, checked in by Özkan İliyaz <iliyaz_96@…>, 4 years ago

initial commit

  • Property mode set to 100644
File size: 755 bytes
Line 
1<?php
2
3namespace App\Http\Requests\Dashboard;
4
5use Illuminate\Foundation\Http\FormRequest;
6use Illuminate\Support\Facades\Auth;
7use Illuminate\Validation\Rule;
8
9class 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.