This commit is contained in:
2026-02-03 15:31:29 +05:00
commit 326c677e8d
2800 changed files with 1489388 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Http\Controllers\Api\V1\Entrepreneur\Requests;
use Illuminate\Foundation\Http\FormRequest;
class VendorProductStoreRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
// essentials...
'name' => ['required', 'string', 'max:255'],
'description' => ['nullable', 'string', 'max:255'],
'files' => ['nullable'],
// prices...
'cost_amount' => ['required', 'numeric'],
'old_price_amount' => ['nullable', 'numeric', 'gt:cost_amount'],
// relationships...
// 'integer', 'exists:brands,id'
'brand_id' => ['nullable'],
'category_ids' => ['required', 'array'],
'collection_ids' => ['nullable', 'array'],
// inventories...
'stock' => ['required', 'integer', 'min:1'],
'sku' => ['nullable', 'string', 'max:255'],
'barcode' => ['nullable', 'string', 'max:255', 'unique:products,barcode'],
];
}
}

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Http\Controllers\Api\V1\Entrepreneur\Requests;
use Illuminate\Foundation\Http\FormRequest;
class VendorProductUpdateRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
// essentials...
'name' => ['required', 'string', 'max:255'],
'description' => ['nullable', 'string', 'max:255'],
'new_imgs' => ['nullable'],
'deleted_images' => ['nullable'],
// prices...
'cost_amount' => ['required', 'numeric'],
'old_price_amount' => ['nullable', 'numeric', 'gt:cost_amount'],
// relationships...
'brand_id' => ['nullable', 'integer', 'exists:brands,id'],
'category_ids' => ['required', 'array'],
'collection_ids' => ['nullable', 'array'],
// inventories...
'stock' => ['required', 'integer', 'min:1'],
'sku' => ['nullable', 'string', 'max:255'],
'barcode' => ['nullable', 'string', 'max:255'],
];
}
}