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