Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| RemoveEntryRequest | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| authorize | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| rules | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Requests\v2\UserFieldInjection; |
| 4 | |
| 5 | use Illuminate\Foundation\Http\FormRequest; |
| 6 | |
| 7 | /** |
| 8 | * Request for adding or restoring a removed entry in user field injection config. |
| 9 | * |
| 10 | * @property string $domain The domain name of the global entry |
| 11 | * @property string $selector The CSS selector of the global field to remove/restore |
| 12 | */ |
| 13 | class RemoveEntryRequest extends FormRequest |
| 14 | { |
| 15 | /** |
| 16 | * Determine if the user is authorized to make this request. |
| 17 | */ |
| 18 | public function authorize(): bool |
| 19 | { |
| 20 | return $this->user() !== null; |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * Get the validation rules that apply to the request. |
| 25 | * |
| 26 | * @return array<string, mixed> |
| 27 | */ |
| 28 | public function rules(): array |
| 29 | { |
| 30 | return [ |
| 31 | 'domain' => ['required', 'string'], |
| 32 | 'selector' => ['required', 'string'], |
| 33 | ]; |
| 34 | } |
| 35 | } |