1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace App\Http\Requests\API\Task;
- use App\Http\Requests\RuleHelper;
- use Illuminate\Foundation\Http\FormRequest;
- use Illuminate\Validation\Rule;
- class BatchCreateRequest extends FormRequest
- {
- use RuleHelper;
- /**
- * Determine if the user is authorized to make this request.
- */
- public function authorize(): bool
- {
- return true;
- }
- /**
- * Get the validation rules that apply to the request.
- *
- * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
- */
- public function rules(): array
- {
- return [
- 'project_id' => [
- 'required',
- Rule::exists('projects', 'id')->where($this->userCompanyWhere()),
- ],
- 'items' => [
- 'required', 'array'
- ]
- ];
- }
- }
|