descom / descommarket-seo
Descommarket SEO
Installs: 3 396
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
Open Issues: 2
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-11-18 16:10:36 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)), ]; }