UpdateCustomerRequest.php 656 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Shop\Customers\Requests;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. use Illuminate\Validation\Rule;
  5. class UpdateCustomerRequest extends FormRequest
  6. {
  7. /**
  8. * Determine if the user is authorized to make this request.
  9. *
  10. * @return bool
  11. */
  12. public function authorize()
  13. {
  14. return true;
  15. }
  16. /**
  17. * Get the validation rules that apply to the request.
  18. *
  19. * @return array
  20. */
  21. public function rules()
  22. {
  23. return [
  24. 'name' => ['required'],
  25. 'email' => ['required', 'email', Rule::unique('customers')->ignore($this->segment(3))]
  26. ];
  27. }
  28. }