public function generateHash($force = false)
{
if ($this->lineItem === false) {
$this->itemHash = null;
$cartItemArray = (array) $this;
unset($cartItemArray['options']['qty']);
ksort($cartItemArray['options']);
$this->itemHash = app(LaraCart::HASH, $cartItemArray);
} elseif ($force || empty($this->itemHash) === true) {
$this->itemHash = app(LaraCart::RANHASH);
}
app('events')->fire('laracart.updateItem', ['item' => $this, 'newHash' => $this->itemHash]);
return $this->itemHash;
}