'required|int', 'answer' => 'required|string|max:255' ]; public function __construct(array $properties = []) { parent::__construct(); $this->fill($properties); return $this; } // PUBLIC METHODS /** * Get unanswered question for a specific customer * * @param \LDC\LDCCRM\Models\Customer $customer * @return bool */ public static function setQuestionAnswers(string $hashcode, int $questionId, array $answersId): bool { self::assertValidHascode($hashcode); self::assertValidPrimaryKey($questionId); if (!count($answersId)) { return true; } foreach ($answersId as $answerId) { self::assertValidPrimaryKey($answerId); } static::setUpApiInterface(); // set apiInterface $request = Utils::getResquest( 'apiV2.customers.answers.store', [ 'customer' => $hashcode ], [ 'question' => $questionId, 'answers' => $answersId ] ); $response = static::$apiInterface->call($request); return $response->status->equals(ApiStatus::OK()); } }