filippo-toso/open-graph-protocol

A Laravel facade to render Open Graph Protocol tags

v1.0.0 2020-01-29 10:11 UTC

This package is auto-updated.

Last update: 2024-10-29 05:41:12 UTC


README

Latest Version on Packagist

Installation

You can install the package via composer:

composer require filippo-toso/open-graph-protocol

Usage

The Ogp facade alias is available everywhere. You can use it in your controllers but also in a service provider or a middleware.

For instance, in your controller:

Ogp::title('Apple Cookie')
    ->type('article')
    ->image('http://example.org/apple.jpg')
    ->description('Welcome to the best apple cookie recipe never created.')
    ->url();

Then in your view, just place this Blade directive where you want to render the Open Graph Protocol tags:

@ogp

Security

If you discover any security related issues, please email filippo@toso.dev instead of using the issue tracker.

Acknowledgement

This package is just a simple wrapper around the great chriskonnertz/open-graph package.

Credits

License

The MIT License (MIT). Please see License File for more information.