A mobiosolutions team has created laravel package for getting all kind of meta tags from given URL.
GitHub : https://github.com/mobiosolutions/metatags
Installation
Perform the following operations in order to use this package
- Run
composer require "mobiosolutions/metatags"
in your terminal
- Add Service Provider
Open
config/app.php
and addmobiosolutions\metatags\Providers\MetatagsProvider::class,
to the end
ofproviders
array:
'providers' => array(
....
mobiosolutions\metatags\Providers\MetatagsProvider::class,
),
Next under thealiases
array:'aliases' => array(
....
'Metatags' =>
mobiosolutions\metatags\Facades\MetatagsFacade::class
),
Requirements
- You need to install the DOM extension.
How to use
After following the above steps,
 // Add to your controller
     use Metatags;
     $metadata = Metatags::get("https://example.com/");
     print_r($metadata);
Happy Coding 🙂