app/Http/Requests/Api/WeappAuthorizationRequest.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()
    {
        switch($this->method()) {
            case 'POST':
                return [
                    'code' => 'required|string',
                ];
                break;
            case 'PUT':
                return [
                    'avatar' => 'required|string',
                    'name' => 'required|string',
                ];
                break;
        }
    }
public function rules ( ) { switch ( $ this -> method ( ) ) { case 'POST' : return [ 'code' => 'required|string' , ] ; break ; case 'PUT' : return [ 'avatar' => 'required|string' , 'name' => 'required|string' , ] ; break ; } }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .