Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Latest commit

 

History

History
51 lines (35 loc) · 1.08 KB

README.md

File metadata and controls

51 lines (35 loc) · 1.08 KB

Metatags

A Laravel package to fetch all metadata of a webpage.

  • Add Service Provider Open config/app.php and add Mobiosolutions\Metatags\Providers\MetatagsProvider::class, to the end of providers array:

    'providers' => array(
        ....
        Mobiosolutions\Metatags\Providers\MetatagsProvider::class,
    ),
    

    Next under the aliases 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 to get all metatags data
    use Metatags;
    
    $metadata = Metatags::get("https://example.com/");
    
    print_r($metadata);
    

    Get only OG ( Open Graph ) Metatages data

    $getOGTags = true;
    $metadata = Metatags::get("https://example.com/",$getOGTags);
    
                        OR
    
    $metadata = Metatags::get("https://example.com/",true);
    
    print_r($metadata);