Issues (64)

app/Http/Requests/ProfileRequest.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace App\Http\Requests;
4
5
use App\User;
0 ignored issues
show
The type App\User was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Illuminate\Foundation\Http\FormRequest;
7
use Illuminate\Validation\Rule;
8
9
class ProfileRequest 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 auth()->check();
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
            'name'  => ['required', 'min:3'],
30
            'email' => ['required', 'email', Rule::unique((new User())->getTable())->ignore(auth()->id())],
31
        ];
32
    }
33
}
34