Skip to content

Retrieved event and setAttribute update the value on database while log out #52821

Answered by 4msar
4msar asked this question in Q&A
Discussion options

You must be logged in to vote

For now, the solution I used by updating the traits with this method implementation.

/**
     * Get the value of the appended attribute.
     *
     * @return string
     */
    public function getAttribute($key)
    {
        $value = parent::getAttribute($key);

        if (in_array($key, $this->columnsForStorageItems())) {
            return $this->getStorageUrl($value);
        }

        return $value;
    }

    /**
     * Get the value of the appended attribute.
     *
     * @return string
     */
    public function toArray()
    {
        $array = parent::toArray();

        foreach ($this->columnsForStorageItems() as $column) {
            if (isset($array[$column])) {
        …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@4msar
Comment options

@4msar
Comment options

Answer selected by 4msar
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #52820 on September 17, 2024 06:18.