descom / descommarket-seo
Descommarket SEO
Installs: 3 352
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
Requires
- php: ^8.0
- laravel/framework: ^9.0|^10.0|^11.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.4
- nunomaduro/larastan: ^2.0
- orchestra/testbench: ^7.5|^8.0|^9.0
- phpstan/phpstan: ^1.2
- phpunit/phpunit: ^9.3|^10.0|^10.5
This package is auto-updated.
Last update: 2024-10-18 15:59:19 UTC
README
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)), ]; }