all(), [ 'name' => 'required', 'description' => 'required', ]);//1024 if ($error->fails()) { return response(['error' => ['code' => 400, 'message' => 'Validation error', 'errors' => $error->errors()]], 400); } else{ SportCourses::create([ 'name' => $request->name, 'description' => $request->description ]); return response(['Новый курс создан'], 200); } } }