¿How to create a custom FormRequest from normal Request?

  laravel, laravel-formrequest, php, request

I find something lost…

The problem

I need to construct 2 custom FormRequest from 1 normal Request
Let’s suppose this fake scenario

First FormRequest

StoreClientRequest

Second FormRequest

UpdateClientRequest

On the Controller:

public function store(Request $request){
    //Do something...
    $firstRequest = new StoreClientRequest($request);
    $secondRequest = new UpdateClientRequest($request);
}

Are there way to make something similar to this fake scenario.

Source: Ask PHP

LEAVE A COMMENT