Initial commit
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
/**
|
||||
* Walidacja edycji typu kabla (site206E). Reguły jak przy dodawaniu - wgranie
|
||||
* nowego pliku zastępuje dotychczasowy tej samej roli; brak pliku = bez zmian.
|
||||
*/
|
||||
class UpdateCableRequest 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',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user