Запрос Laravel: метод BadMethodCallException getPath не существует

Я пытался добавить некоторую проверку в запрос, я получаю сообщение об ошибке «Метод BadMethodCallException getPath не существует». Я отправляю только нулевое значение в почтальоне, чтобы проверить его. Например:

{

"имя": ноль

}

Вот мой контроллер:

namespace Modules\Settings\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Controller;
use Illuminate\Http\JsonResponse;
use Modules\Settings\Repositories\SettingsInterface;

use Modules\Settings\Http\Requests\AddCommunicationType;

class SettingsController extends Controller
{


 public function addCommunicationType(AddCommunicationType $request)
{
        $data =  json_decode(json_encode($request->all()));
        $com=$this->settingRepo->addCommunicationType($data);
        return response()->json($com);

}
}

Запрос AddCommunicationType:

namespace Modules\Settings\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class AddCommunicationType extends FormRequest
{
/**
 * Get the validation rules that apply to the request.
 *
 * @return array
 */
public function rules()
{
    return [
        //
    'name'=>'required',
    ];
}

/**
 * Determine if the user is authorized to make this request.
 *
 * @return bool
 */
public function authorize()
{
    return true;
}


public function messages() {
    return [
        'name.required' => 'Name is required.',

    ];
}

}

Маршрут:

 Route::post('settings/addCommunicationType', 'SettingsController@addCommunicationType');

person user3810794    schedule 01.11.2017    source источник
comment
композитор дамп-автозагрузка ; Конфигурация композитора: очистить и убедиться, что у вас правильное пространство имен   -  person Leo    schedule 01.11.2017
comment
@LeoKelmendi пробовал их все так же.   -  person user3810794    schedule 01.11.2017
comment
Какая у вас версия ларавеля?   -  person Dharma Saputra    schedule 01.11.2017
comment
@DharmaSaputra 5.5.19   -  person user3810794    schedule 01.11.2017
comment
Возможный дубликат метода Laravel 5.5 getPath не существует   -  person Indra    schedule 05.12.2017