1
0
mirror of https://github.com/robonen/metr.git synced 2026-03-20 02:44:42 +00:00

Offer and order controllers

This commit is contained in:
2022-05-27 12:01:28 +07:00
parent c4f98fdb58
commit dc539ed911
21 changed files with 493 additions and 29 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Http\Requests;
use App\Enums\OrderTypesEnum;
use Illuminate\Validation\Rules\Enum;
class StoreOfferRequest extends BaseRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array<string, mixed>
*/
public function rules(): array
{
return [
'owner_id' => ['required', 'numeric', 'exists:users,id'],
'name' => ['required', 'string'],
'type' => ['required', new Enum(OrderTypesEnum::class)],
'price' => ['required', 'numeric'],
'rooms' => ['required', 'numeric'],
'yandex_mark' => ['string'],
'location' => ['required', 'string'],
'description' => ['required', 'string'],
'is_group' => ['required', 'boolean'],
];
}
}