Laravel 5.5 - Validate Multiple Form Request - at the same time

前端 未结 7 1329
臣服心动
臣服心动 2020-12-18 13:17

The question is already asked here for a previous version of laravel and not yet answered.

I have a html form which is validated using three different

7条回答
  •  没有蜡笔的小新
    2020-12-18 13:34

    You could concatinate all rules and validate manually:

    $allRules = (new TransportationRequest)->rules() + (new PurchaseRequest)->rules() + (new SaleRequest)->rules();
    Validator::make($request->all(), $allRules)->validate();
    

提交回复
热议问题