StoreReclamationRequest.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace App\Http\Requests;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class StoreReclamationRequest extends FormRequest
  5. {
  6. /**
  7. * Determine if the user is authorized to make this request.
  8. */
  9. public function authorize(): bool
  10. {
  11. return hasRole('admin,manager');
  12. }
  13. /**
  14. * Get the validation rules that apply to the request.
  15. *
  16. * @return array
  17. */
  18. public function rules(): array
  19. {
  20. return [
  21. 'user_id' => 'required|exists:users,id',
  22. 'status_id' => 'required|exists:reclamation_statuses,id',
  23. 'reason' => 'nullable|string',
  24. 'guarantee' => 'nullable|string',
  25. 'whats_done' => 'nullable|string',
  26. 'create_date' => 'required|date',
  27. 'finish_date' => 'required|date',
  28. 'start_work_date' => 'nullable|date',
  29. 'work_days' => 'nullable|integer',
  30. 'brigadier_id' => 'nullable|exists:users,id',
  31. ];
  32. }
  33. }