artesaos / seotools

SEO Tools for Laravel
MIT License
3.04k stars 503 forks source link

Is this package support macro ? #231

Closed omarherri closed 1 year ago

omarherri commented 3 years ago

can you please tell me if this package support macro feature, so that i can use some of the code in multiple places.

this is an exemple of use case:

Macro file:

SEO::macro('detail', function ($product) {
    SEO::jsonLd()->addValue('@graph', [
     '@type' => 'Product',
                '@id' => request()->url() . '#product',
                'name' => ucfirst($product->meta->name),
                'url' => request()->url(),
                'description' => ucfirst($product->meta->name)
                //....
    ]);
});

And in my controller i can use this: SEO::detail($product);

J-Brk commented 1 year ago

Reference to original pull request: https://github.com/artesaos/seotools/pull/256