File: D:/HostingSpaces/SBogers10/shop.komma.nl/app/Orders/Requests/ByStatusRequest.php
<?php declare(strict_types=1);
namespace App\Orders\Requests;
use App\Orders\Models\Order;
use App\Orders\OrderStatus;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class ByStatusRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return $this->user('kms')->can('index', Order::class);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'statuses' => 'required',
'statuses.*' => ['string', Rule::in(OrderStatus::getAsArray())]
];
}
}