src/Http/FormRequest.php
protected function setupValidationScenario()
    {
        $current = $this->method();
        $available = [
            'POST' => 'store',
            'PUT' => 'update',
            'DELETE' => 'destroy',
        ];

        if (in_array($current, $available)) {
            $this->onValidationScenario($available[$current]);
        }
    }
protected function setupValidationScenario()
    {
        $current = $this->method();
        $available = [
            'POST' => 'store',
            'PUT' => 'update',
            'DELETE' => 'destroy',
        ];

        if (in_array($current, $available)) {
            $this->onValidationScenario($available[$current]);
        }
    }
protected function setupValidationScenario ( ) { $ current = $ this -> method ( ) ; $ available = [ 'POST' => 'store' , 'PUT' => 'update' , 'DELETE' => 'destroy' , ] ; if ( in_array ( $ current , $ available ) ) { $ this -> onValidationScenario ( $ available [ $ current ] ) ; } }
Setup validation scenario based on request method.

@return void
Setup validation scenario based on request method .