Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 977 Bytes

README.md

File metadata and controls

36 lines (26 loc) · 977 Bytes

DescomMarket Seo

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)),
        ];
    }