public function __construct($attributes = null) { // generate unique hash $this->hash = md5(uniqid(mt_rand(), true)); parent::__construct($attributes); }