Passed
Push — dependabot/npm_and_yarn/dev/st... ( 790070...2dbd00 )
by
unknown
17:44 queued 12:22
created

StoreComment::authorize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Http\Requests;
4
5
use App\Models\Comment;
6
use App\Models\JobPoster;
7
use App\Models\Lookup\CommentType;
8
use App\Models\User;
9
use App\Services\Validation\Rules\ValidIdRule;
10
use Illuminate\Foundation\Http\FormRequest;
11
use Illuminate\Support\Facades\Log;
12
13
class StoreComment extends FormRequest
14
{
15
    /**
16
     * Determine if the user is authorized to make this request.
17
     *
18
     * @return bool
19
     */
20
    public function authorize()
21
    {
22
        return true;
23
    }
24
25
    /**
26
     * Get the validation rules that apply to the request.
27
     *
28
     * @return array
29
     */
30
    public function rules()
31
    {
32
        return [
33
            'comment' => 'nullable|string',
34
            'location' => 'nullable|string',
35
            'type_id' => ['nullable', new ValidIdRule(CommentType::class)]
36
        ];
37
    }
38
}
39