Skip to content

A Laravel package to fetch Open Graph data of a website.

License

Notifications You must be signed in to change notification settings

cloudnepal/OpenGraph

Repository files navigation

Laravel OpenGraph

A Laravel package to fetch Open Graph metadata of a website.

Latest Version on Packagist Total Downloads Scrutinizer Code Quality StyleCI Build Status

Installation

Perform the following operations in order to use this package

  • Run composer require "shweshi/opengraph" in your terminal

If you do not run Laravel 5.5 (or higher), then add the service provider in config/app.php:

  • Add Service Provider Open config/app.php and add shweshi\OpenGraph\Providers\OpenGraphProvider::class, to the end of providers array:

    'providers' => array(
        ....
        shweshi\OpenGraph\Providers\OpenGraphProvider::class,
    ),
    

    Next under the aliases array:

    'aliases' => array(
        ....
        'OpenGraph' => shweshi\OpenGraph\Facades\OpenGraphFacade::class
    ),
    

If you do run the package on Laravel 5.5+, package auto-discovery takes care of the magic of adding the service provider.

Requirements

  • You need to install the DOM extension.

How to use

  • After following the above steps,

    use OpenGraph;
    
    $data = OpenGraph::fetch("https://unsplash.com/");
    
    print_r($data);
    

Happy coding!

About

A Laravel package to fetch Open Graph data of a website.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 86.4%
  • HTML 13.6%