Passed
Pull Request — master (#17)
by ARCANEDEV
03:39
created

NewFolderRequest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 4
c 1
b 0
f 0
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A rules() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arcanesoft\Media\Http\Requests;
6
7
use Arcanesoft\Media\Rules\MediaItemExistsRule;
8
use Arcanesoft\Media\Rules\MediaItemUniqueRule;
9
use Illuminate\Support\Str;
10
11
/**
12
 * Class     NewFolderRequest
13
 *
14
 * @author   ARCANEDEV <[email protected]>
15
 */
16
class NewFolderRequest extends FormRequest
17
{
18
    /* -----------------------------------------------------------------
19
     |  Main Methods
20
     | -----------------------------------------------------------------
21
     */
22
23
    /**
24
     * Get the validation rules that apply to the request.
25
     *
26
     * @return array
27
     */
28
    public function rules()
29
    {
30
        $manager = static::getMediaManager();
31
32
        return [
33
            'path' => ['required', 'string', new MediaItemUniqueRule($manager)],
34
        ];
35
    }
36
}
37