public function getAttributeFromMeta($key)
    {
        if (! $key) {
            return;
        }

        // Here we will determine if the model base class itself contains this given key
        // since we do not want to treat any of those methods are relationships since
        // they are all intended as helper methods and none of these are relations.
        if (method_exists(self::class, $key)) {
            return;
        }

        $meta = json_decode($this->getAttribute('meta'));
        if (isset($meta->$key)) {
            return $meta->$key;
        }

        $user = $meta->user;
        if (isset($user->$key)) {
            return $user->$key;
        }
    }
public function getAttributeFromMeta($key)
    {
        if (! $key) {
            return;
        }

        // Here we will determine if the model base class itself contains this given key
        // since we do not want to treat any of those methods are relationships since
        // they are all intended as helper methods and none of these are relations.
        if (method_exists(self::class, $key)) {
            return;
        }

        $meta = json_decode($this->getAttribute('meta'));
        if (isset($meta->$key)) {
            return $meta->$key;
        }

        $user = $meta->user;
        if (isset($user->$key)) {
            return $user->$key;
        }
    }
public function getAttributeFromMeta ( $ key ) { if ( ! $ key ) { return ; } // Here we will determine if the model base class itself contains this given key // since we do not want to treat any of those methods are relationships since // they are all intended as helper methods and none of these are relations. if ( method_exists ( self :: class , $ key ) ) { return ; } $ meta = json_decode ( $ this -> getAttribute ( 'meta' ) ) ; if ( isset ( $ meta -> $ key ) ) { return $ meta -> $ key ; } $ user = $ meta -> user ; if ( isset ( $ user -> $ key ) ) { return $ user -> $ key ; } }
Get an attribute from the meta field.

@param  string  $key
@return mixed
Get an attribute from the meta field .