src/MongolidModel.php
protected function hashAttributes()
    {
        foreach ($this->hashedAttributes as $attr) {
            // Hash attribute if changed
            if (!isset($this->original[$attr]) || $this->$attr != $this->original[$attr]) {
                $this->$attr = app(Hasher::class)->make($this->$attr);
            }

            // Removes any confirmation field before saving it into the database
            $confirmationField = $attr.'_confirmation';
            if ($this->$confirmationField) {
                unset($this->$confirmationField);
            }
        }
    }
protected function hashAttributes()
    {
        foreach ($this->hashedAttributes as $attr) {
            // Hash attribute if changed
            if (!isset($this->original[$attr]) || $this->$attr != $this->original[$attr]) {
                $this->$attr = app(Hasher::class)->make($this->$attr);
            }

            // Removes any confirmation field before saving it into the database
            $confirmationField = $attr.'_confirmation';
            if ($this->$confirmationField) {
                unset($this->$confirmationField);
            }
        }
    }
protected function hashAttributes ( ) { foreach ( $ this -> hashedAttributes as $ attr ) { // Hash attribute if changed if ( ! isset ( $ this -> original [ $ attr ] ) || $ this -> $ attr != $ this -> original [ $ attr ] ) { $ this -> $ attr = app ( Hasher :: class ) -> make ( $ this -> $ attr ) ; } // Removes any confirmation field before saving it into the database $ confirmationField = $ attr . '_confirmation' ; if ( $ this -> $ confirmationField ) { unset ( $ this -> $ confirmationField ) ; } } }
Hashes the attributes specified in the hashedAttributes
array.
Hashes the attributes specified in the hashedAttributes array .