Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
RolePlaySessionProcessRequest
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 2
12
0.00% covered (danger)
0.00%
0 / 1
 authorize
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
6
 rules
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace App\Http\Requests\v2\RolePlay;
4
5use Illuminate\Foundation\Http\FormRequest;
6
7class RolePlaySessionProcessRequest 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        $conversation = $this->route('conversation');
17
18        if ($conversation->user_id !== $user->id) {
19            return false;
20        }
21
22        return true;
23        return $conversation->status === 'failed';
24    }
25
26    /**
27     * Get the validation rules that apply to the request.
28     *
29     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
30     */
31    public function rules(): array
32    {
33        return [];
34    }
35}