src/Providers/OEmbed.php
protected static function getEndPointFromRequest(Request $request, array $config)
    {
        //Search the oembed provider using the domain
        $class = self::getClassFromRequest($request);

        if (class_exists($class) && $request->match($class::getPatterns())) {
            return [
                'endPoint' => $class::getEndpoint(),
                'params' => $class::getParams($request),
            ];
        }

        //Search using embedly
        if (!empty($config['embedlyKey']) && $request->match(OEmbed\Embedly::getPatterns())) {
            return [
                'endPoint' => OEmbed\Embedly::getEndpoint(),
                'params' => OEmbed\Embedly::getParams($request) + ['key' => $config['embedlyKey']],
            ];
        }
    }
protected static function getEndPointFromRequest(Request $request, array $config)
    {
        //Search the oembed provider using the domain
        $class = self::getClassFromRequest($request);

        if (class_exists($class) && $request->match($class::getPatterns())) {
            return [
                'endPoint' => $class::getEndpoint(),
                'params' => $class::getParams($request),
            ];
        }

        //Search using embedly
        if (!empty($config['embedlyKey']) && $request->match(OEmbed\Embedly::getPatterns())) {
            return [
                'endPoint' => OEmbed\Embedly::getEndpoint(),
                'params' => OEmbed\Embedly::getParams($request) + ['key' => $config['embedlyKey']],
            ];
        }
    }
protected static function getEndPointFromRequest ( Request $ request , array $ config ) { //Search the oembed provider using the domain $ class = self :: getClassFromRequest ( $ request ) ; if ( class_exists ( $ class ) && $ request -> match ( $ class :: getPatterns ( ) ) ) { return [ 'endPoint' => $ class :: getEndpoint ( ) , 'params' => $ class :: getParams ( $ request ) , ] ; } //Search using embedly if ( ! empty ( $ config [ 'embedlyKey' ] ) && $ request -> match ( OEmbed \ Embedly :: getPatterns ( ) ) ) { return [ 'endPoint' => OEmbed \ Embedly :: getEndpoint ( ) , 'params' => OEmbed \ Embedly :: getParams ( $ request ) + [ 'key' => $ config [ 'embedlyKey' ] ] , ] ; } }
Returns the oembed link from the request

@param Request $request
@param array   $config

@return array|null
Returns the oembed link from the request