| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace App\Http\Requests;
- use Illuminate\Foundation\Http\FormRequest;
- class SaveProductRequest extends FormRequest
- {
- /**
- * Determine if the user is authorized to make this request.
- *
- * @return bool
- */
- public function authorize()
- {
- return true; // todo just admin can save it
- }
- /**
- * Get the validation rules that apply to the request.
- *
- * @return array<string, mixed>
- */
- public function rules()
- {
- return [
- 'id' => 'required',
- 'series' => 'required|string',
- 'name' => 'required|string',
- 'name_for_form' => 'required|string',
- 'product_group' => 'required|string',
- 'price' => 'required|numeric',
- 'characteristics' => 'required|string',
- 'tech_description' => 'required|string',
- 'tech_description_short' => 'required|string',
- ];
- }
- }
|