app/Http/Requests/StoreProductRequest.php
/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
Get the validation rules that apply to the request.
@return array
Get the validation rules that apply to the request . @return array
public function rules()
    {
        return  [
            'product_title' => ['required','string','max:255','unique:products'],
            'product_description' => ['required','string'],
            'product_price' => ['required','numeric'],
            'product_quantity' => ['required','integer'],
            'categories' => ['required'],
            'categories.*' => ['integer'],
        ];
    }
public function rules ( ) { return [ 'product_title' => [ 'required' , 'string' , 'max:255' , 'unique:products' ] , 'product_description' => [ 'required' , 'string' ] , 'product_price' => [ 'required' , 'numeric' ] , 'product_quantity' => [ 'required' , 'integer' ] , 'categories' => [ 'required' ] , 'categories.*' => [ 'integer' ] , ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .