app/Http/Requests/ExamRequest.php
/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
Get the validation rules that apply to the request.
@return array
Get the validation rules that apply to the request . @return array
public function rules()
    {
        $rules = [];
        switch ($this->method()) {
            case 'POST':
                $rules = [
                    'theme_id' => 'required',
                    'name' => 'required',
                    'level' => 'required',
                ];
                break;
            case 'PUT':
                $rules = [
                    'theme_id' => 'required',
                    'name' => 'required',
                    'level' => 'required',
                    'status' => 'required',
                ];
                break;
        }
        return $rules;
    }
public function rules ( ) { $ rules = [ ] ; switch ( $ this -> method ( ) ) { case 'POST' : $ rules = [ 'theme_id' => 'required' , 'name' => 'required' , 'level' => 'required' , ] ; break ; case 'PUT' : $ rules = [ 'theme_id' => 'required' , 'name' => 'required' , 'level' => 'required' , 'status' => 'required' , ] ; break ; } return $ rules ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .