Laravel clean code : instead of using if use these 2 rules

Поделиться
HTML-код
  • Опубликовано: 15 янв 2025
  • НаукаНаука

Комментарии • 9

  • @bakhtiar.ramadhan
    @bakhtiar.ramadhan 3 месяца назад

    Nice To Know

  • @fifthavenue2105
    @fifthavenue2105 3 месяца назад

    Thanks man!

  • @k_fc_
    @k_fc_ 3 месяца назад

    and if you want to validate the array key for e.g
    color.size => [here goes the rules, "required","in:s,m,l,xl" and so on]

    • @laravelboy
      @laravelboy  3 месяца назад +1

      ruclips.net/video/I9lcaQDU0Mg/видео.html

  • @localLyricsPh
    @localLyricsPh 3 месяца назад

    how did you know that the "required_array_keys" attribute exist ? where did you find the list of available attributes for validation?

    • @laravelboy
      @laravelboy  3 месяца назад

      from laravel documentation:
      laravel.com/docs/11.x/validation#available-validation-rules

  • @annm2855
    @annm2855 3 месяца назад

    What if i want color to be nullable and size will be required?
    How can we go about it using required_array_keys?

    • @laravelboy
      @laravelboy  2 месяца назад +1

      in this case you may make it independently for each key