亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

php - How to create a validate class in laravel to call multiple form submission controllers?
過去多啦不再A夢
過去多啦不再A夢 2017-07-06 10:34:45
0
2
1214

How to create a validate class in laravel to call multiple form submission controllers?
I have a page with about 7 places that need to be verified, but in the controller I assigned a static page to each verification place.
The boss asked to write a validate class that includes these 7 places. validation rules, and then call them by passing parameters. . . I don't understand. . Please help me a lot

This is a validate rule. How to do it? Only call one of the validation rules

過去多啦不再A夢
過去多啦不再A夢

reply all(2)
學(xué)習(xí)ing

Use Form Request

  1. In this, cross-check which form elements exist, and then only apply the rules for existing elements.

  2. Wherever this verification is needed, just inject it.

學(xué)霸
php artisan make:request DemoRequest

You can generate a Request class for form verification. The file generated by this command is located in the app/Http/Requests/ folder. You can see that there are two methods in it: authorize() and rules() for form verification modifications. Just rules, and then reference DemoRequest when the controller initializes $request.

public function store(Requests\DemoRequest $request)
    {
        $input = $request->all();
        //....
     }   
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template