Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
SearchDataRequest
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 authorize
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 rules
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace App\Http\Requests\v2\SearchData;
4
5use Illuminate\Foundation\Http\FormRequest;
6
7/**
8 * Request validation for the search-data endpoint.
9 *
10 * Validates the search query parameter used to find shortcuts and templates
11 * by title, text content, shortcut name, or first line.
12 *
13 * @property string $query The search term to look for (minimum 1 character)
14 */
15class SearchDataRequest extends FormRequest
16{
17    /**
18     * Determine if the user is authorized to make this request.
19     */
20    public function authorize(): bool
21    {
22        return true;
23    }
24
25    /**
26     * Get the validation rules that apply to the request.
27     *
28     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
29     */
30    public function rules(): array
31    {
32        return [
33            'query' => 'required|string|min:1',
34        ];
35    }
36}