create image upload endpoint create product creation endpoint create get product categories endpoint
25 lines
566 B
PHP
25 lines
566 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class CreateProductRequest extends FormRequest
|
|
{
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'title' => 'required|string|max:255',
|
|
'description' => 'required|string',
|
|
'product_category_id' => 'required|exists:product_categories,id',
|
|
'actual_price' => 'required|numeric|min:0',
|
|
'list_price' => 'required|numeric|min:0',
|
|
];
|
|
}
|
|
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
}
|