Files
2026-09-03 12:21:17 +02:00

40 lines
1.2 KiB
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
/**
* Walidacja dodania/edycji typu kabla (site206A/E). Pliki opcjonalne:
* dokumentacja katalogowa (PDF/Office) oraz zdjęcie. Limit 8 MB (mediumblob 16 MB).
*/
class StoreCableRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255'],
'manufacturer_id' => ['required', 'integer', 'exists:seg_manufacturers,MCF_ID'],
'description' => ['nullable', 'string', 'max:255'],
'catalogue_file' => ['nullable', 'file', 'mimes:pdf,doc,docx,xls,xlsx,ppt,pptx', 'max:8192'],
'image_file' => ['nullable', 'image', 'mimes:jpg,jpeg,png,gif,bmp', 'max:8192'],
];
}
public function attributes(): array
{
return [
'name' => 'typ kabla',
'manufacturer_id' => 'producent',
'description' => 'opis',
'catalogue_file' => 'dokumentacja katalogowa',
'image_file' => 'zdjęcie',
];
}
}