Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
GetRolePlayAgentsRequest | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
1 / 1 |
authorize | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
rules | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace App\Http\Requests\v2\RolePlay; |
4 | |
5 | use Illuminate\Foundation\Http\FormRequest; |
6 | |
7 | class GetRolePlayAgentsRequest extends FormRequest |
8 | { |
9 | /** |
10 | * Determine if the user is authorized to make this request. |
11 | * |
12 | * @return bool |
13 | */ |
14 | public function authorize(): bool |
15 | { |
16 | $user = $this->user(); |
17 | |
18 | $project = $this->route('persona'); |
19 | |
20 | return !$project || $user->id === $project->user_id; |
21 | } |
22 | |
23 | /** |
24 | * Get the validation rules that apply to the request. |
25 | * |
26 | * @return array |
27 | */ |
28 | public function rules(): array |
29 | { |
30 | return []; |
31 | } |
32 | } |