Passed
Push — dependabot/npm_and_yarn/dev/st... ( 917c39...79f3f4 )
by
unknown
12:32 queued 07:14
created

StoreComment   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A authorize() 0 3 1
A rules() 0 6 1
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