ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Object array 유효성 검사하는법
    Laravel 2020. 7. 19. 19:24
    반응형
    SMALL
          $request->validate([
                "menus" => "required|array|max:100",
                "menus.*.title" => "required|string|max:500",
                "menus.*.body" => "required|string|max:500",
                "menus.*.price" => "required|integer|min:0",
            ]);
            
         /*
         $menus = [
                [
                    "title" => "test",
                    "body" => "test",
                    "price" => 1000,
                ],
                [
                    "title" => "test",
                    "body" => "test",
                    "price" => 1000,
                ],
            ]
         */
    LIST

    'Laravel' 카테고리의 다른 글

    Mail(메일)  (0) 2020.11.01
    whereExists  (0) 2020.08.18
    Job(Queue)  (0) 2020.06.14
    ENUM  (0) 2020.05.31
    엑셀(Excel) 다루기  (0) 2020.04.27

    댓글

Designed by Tistory.