<?php

namespace Statamic\Addons\LinkOgData;

use Statamic\Extend\Fieldtype;

class LinkOgDataFieldtype extends Fieldtype
{
    protected function init()
    {
        $this->linkogdata = new LinkOgData;
    }

    /**
     * The blank/default value
     *
     * @return array
     */
    public function blank()
    {
        return [
            'url' => null
        ];
    }

    /**
     * Pre-process the data before it gets sent to the publish page
     *
     * @param mixed $data
     * @return array|mixed
     */
    public function preProcess($data)
    {
        return $data;
    }

    /**
     * Process the data before it gets saved
     *
     * @param mixed $data
     * @return array|mixed
     */
    public function process($data)
    {
        $url = $data['url'];

	$data = [
            'url' => $data['url'],
        ];

        $result = $this->linkogdata->getOgData($url);

        return array_merge($data, $result);
    }
}

<?php

namespace Statamic\Addons\LinkOgData;

use Statamic\Extend\Fieldtype;

class LinkOgDataFieldtype extends Fieldtype
{
    /**
     * The blank/default value
     *
     * @return array
     */
    public function blank()
    {
        return [
            'url' => null
        ];
    }

    /**
     * Pre-process the data before it gets sent to the publish page
     *
     * @param mixed $data
     * @return array|mixed
     */
    public function preProcess($data)
    {
        return $data;
    }

    /**
     * Process the data before it gets saved
     *
     * @param mixed $data
     * @return array|mixed
     */
    public function process($data)
    {
        return $data;
    }
}

Remove redundant lookup from field type process
Remove redundant lookup from field type process
