mardi 3 novembre 2015

Laravel Multiple Form Request Validation

I have products and software and movie belongs to product. I have created two validation requests and want to validate them like shown below.

public function store(StoreProductRequest $old_request)
{
    if ($old_request->type == 'MOVIE')
        $request = new StoreMovieRequest;
    else
        $request = new StoreSoftwareRequest;

    $request = $old_request;
    $request->validate();
}

Is there any way to achieve this in Laravel 5.1? I hope you understand my question.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire