descom/descommarket-seo

Descommarket SEO

1.1.0 2024-04-18 14:51 UTC

This package is auto-updated.

Last update: 2024-10-18 15:59:19 UTC


README

tests analyze

Installation

composer require descom-es/descommarket-seo
php artisan migrate

Usage

Configure yor model to use Seo

Add Trait DescomMarket\Seo\Traits in your Model that required Seo.

Add Seo to your model

    $product->addMeta('title', 'new title to product');
    $product->addMeta('description', 'Meta description to product');

Get MetaResource to your API

    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'meta' => $this->whenLoaded('meta', new MetaResource($this->meta)),
        ];
    }