Download the PHP package quangtam/opengraph without Composer
On this page you can find all versions of the php package quangtam/opengraph. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download quangtam/opengraph
More information about quangtam/opengraph
Files in quangtam/opengraph
Package opengraph
Short Description A Laravel package to fetch website Open Graph metadata.
License MIT
Informations about the package opengraph
A Laravel package to fetch Open Graph metadata of a website.
Features
-
Easily fetch metadata of a url. Laravel OpenGraph fetch all the metadata of a URL.
-
Supports language specific metadata. Laravel OpenGraph can fetch metadata in a specific language if webpage supports.
-
Supports twitter metadata. Laravel OpenGraph supports twitter OG data too.
- Verify image URL. Laravel OpenGraph verifies that the image url in the image metadata is valid or not.
Demo
How to use Laravel OpenGraph
Article can be found on medium blog: https://hackernoon.com/how-to-fetch-open-graph-metadata-in-laravel-2d5d674904d7
Installation
Perform the following operations in order to use this package
- Install via composer
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 addshweshi\OpenGraph\Providers\OpenGraphProvider::class,
to the end ofproviders
array:Next under the
aliases
array:
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,
this will give you an array like this..
You can also pass an optional parameter either true or false along with url. When set false it will only fetch basic metadata and in case of true it will fetch all the other optional metadata as well like audio, video, music and twitter metatags as well.
this will give you an array like this..
To fetch the metadata in a specific language you can pass the language as the third argument, this value will be used as the Accept-Language header.
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CODE OF CONDUCT for details.
License
The MIT License (MIT). Please see License File for more information.