public function mapRelatives()
    {
        $relations = collect($this->relations());

        if ($relations->isEmpty()) {
            return false;
        }

        return $this->items = collect($this->all())
            ->map(function ($value, $key) use ($relations) {
                if ($relations->has($key)) {
                    $className = $relations->get($key);

                    return new $className($value);
                }

                return $value;
            })
            ->all();
    }
public function mapRelatives()
    {
        $relations = collect($this->relations());

        if ($relations->isEmpty()) {
            return false;
        }

        return $this->items = collect($this->all())
            ->map(function ($value, $key) use ($relations) {
                if ($relations->has($key)) {
                    $className = $relations->get($key);

                    return new $className($value);
                }

                return $value;
            })
            ->all();
    }
public function mapRelatives ( ) { $ relations = collect ( $ this -> relations ( ) ) ; if ( $ relations -> isEmpty ( ) ) { return false ; } return $ this -> items = collect ( $ this -> all ( ) ) -> map ( function ( $ value , $ key ) use ( $ relations ) { if ( $ relations -> has ( $ key ) ) { $ className = $ relations -> get ( $ key ) ; return new $ className ( $ value ) ; } return $ value ; } ) -> all ( ) ; }
Map property relatives to appropriate objects.

@return array|bool
Map property relatives to appropriate objects .