<?php
 namespace App\Http\Requests\Admin; use Illuminate\Foundation\Http\FormRequest; class ProductGroupStoreRequest extends FormRequest { public function authorize(): bool { return $this->user()->can('create', \App\Models\ProductGroup::class); } public function rules(): array { return [ 'name' => 'required|string|max:255|unique:product_groups', 'description' => 'nullable|string', 'icon' => 'nullable|string', 'order' => 'required|integer|min:0', 'hidden' => 'nullable|boolean', 'gateways' => 'nullable|string', 'template' => 'nullable|string', 'is_active' => 'boolean', 'proration_enabled' => 'nullable|in:,0,1', 'billing_anchor_day' => 'nullable|integer|min:1|max:31', ]; } public function messages(): array { return [ 'name.required' => __('admin/product-groups.validation.name.required'), 'name.unique' => __('admin/product-groups.validation.name.unique'), 'order.required' => __('admin/product-groups.validation.order.required'), 'order.integer' => __('admin/product-groups.validation.order.integer'), 'order.min' => __('admin/product-groups.validation.order.min'), ]; } } 