Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| StoreCategoryRequest | |
0.00% |
0 / 10 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| authorize | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| rules | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| messages | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Requests\configuration; |
| 4 | |
| 5 | use Illuminate\Foundation\Http\FormRequest; |
| 6 | use Illuminate\Http\Request; |
| 7 | |
| 8 | class StoreCategoryRequest extends FormRequest |
| 9 | { |
| 10 | /** |
| 11 | * Determine if the user is authorized to make this request. |
| 12 | * |
| 13 | * @return bool |
| 14 | */ |
| 15 | public function authorize() |
| 16 | { |
| 17 | return false; |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Get the validation rules that apply to the request. |
| 22 | * |
| 23 | * @return array<string, mixed> |
| 24 | */ |
| 25 | public function rules(Request $request) |
| 26 | { |
| 27 | return [ |
| 28 | 'image' => 'mimes:png,jpg,jpeg,mp4', |
| 29 | 'parent_id' => 'nullable', |
| 30 | 'description' => 'nullable', |
| 31 | ]; |
| 32 | } |
| 33 | |
| 34 | public function messages() |
| 35 | { |
| 36 | return [ |
| 37 | 'name.unique' => 'Plese try another Category Name', |
| 38 | 'name.required' => 'category Name Not be empty', |
| 39 | ]; |
| 40 | } |
| 41 | } |