### Install SEOTools Package Source: https://github.com/artesaos/seotools/blob/master/README.md Installs the SEOTools package using Composer. This command updates your composer.json file and downloads the necessary dependencies. ```shell composer require artesaos/seotools ``` -------------------------------- ### Lumen Integration Example Source: https://github.com/artesaos/seotools/blob/master/README.md Illustrates how to access SEOTools services within a Lumen application, as Lumen does not support facades. It shows retrieving instances for metatags, Twitter, OpenGraph, and JSON-LD. ```php generate(); ``` -------------------------------- ### SEOMeta API Reference Source: https://github.com/artesaos/seotools/blob/master/README.md Comprehensive API documentation for the SEOMeta class, covering methods for setting and retrieving meta tags, keywords, titles, descriptions, canonical URLs, robots directives, and alternate languages. Includes examples of method chaining and resetting. ```APIDOC SEOMeta: // Adding keywords addKeyword(string $keyword) - Adds a single keyword to the meta keywords tag. // Adding custom meta tags addMeta(string $meta, string $value = null, string $name = 'name') - Adds a custom meta tag. $meta is the attribute name (e.g., 'charset', 'name'), $value is the tag's content. // Managing alternate languages addAlternateLanguage(string $lang, string $url) - Adds an alternate language link. addAlternateLanguages(array $languages) - Adds multiple alternate language links from an array. setAlternateLanguage(string $lang, string $url) - Sets a single alternate language link. setAlternateLanguages(array $languages) - Sets multiple alternate language links from an array. // Title management setTitleSeparator(string $separator) - Sets the separator used between the page title and site name. setTitle(string $title) - Sets the page title. setTitleDefault(string $default) - Sets a default title if none is explicitly set. // Description management setDescription(string $description) - Sets the meta description. // Keywords management setKeywords(string $keywords) - Sets all meta keywords at once. // Robots directive management setRobots(string $robots) - Sets the meta robots tag (e.g., 'index, follow'). // Canonical URL management setCanonical(string $url) - Sets the canonical URL. getCanonical(string $url) - Retrieves the canonical URL. // Prev/Next link management setPrev(string $url) - Sets the rel="prev" link. setNext(string $url) - Sets the rel="next" link. getPrev(string $url) - Retrieves the rel="prev" link. getNext(string $url) - Retrieves the rel="next" link. // Removing meta tags removeMeta(string $key) - Removes a meta tag by its key. // Chaining methods example: // SEOMeta::setTitle($title) // ->setDescription($description) // ->setKeywords($keywords) // ->addKeyword($keyword) // ->addMeta($meta, $value); // Retrieving data getTitle(): string - Retrieves the current page title. getTitleSession(): string - Retrieves the page title from the session. getTitleSeparator(): string - Retrieves the current title separator. getKeywords(): string - Retrieves the meta keywords. getDescription(): string - Retrieves the meta description. getRobots(): string - Retrieves the meta robots tag. // Resetting SEOMeta data reset(): void - Resets all SEOMeta properties to their default values. // Generating the final HTML output generate(): string - Generates the complete HTML meta tag output for SEOMeta. ``` -------------------------------- ### Microdata HTML Markup Example Source: https://github.com/artesaos/seotools/blob/master/README.md An example of Microdata HTML markup structure. Note that this package does not generate Microdata, recommending JSON Linked Data instead. ```html

My name is Elizabeth.

``` -------------------------------- ### Custom Macro for Web Page SEO Source: https://github.com/artesaos/seotools/blob/master/README.md Illustrates how to extend the SEOTools package using its Macroable trait to create custom functionalities. This example defines a 'webPage' macro to set title, description, canonical URL, and OpenGraph properties for a webpage. ```php SEOTools::macro('webPage', function (string $title, string $description) { SEOMeta::setTitle($title); SEOMeta::setDescription($description); SEOMeta::setCanonical('http://current.url.com'); OpenGraph::setDescription($description); OpenGraph::setTitle($title); OpenGraph::setUrl('http://current.url.com'); OpenGraph::addProperty('type', 'webpage'); }); ``` ```php SEOTools::webPage('Page title', 'Page description'); ``` -------------------------------- ### Manage Twitter Card Tags with PHP Source: https://github.com/artesaos/seotools/blob/master/README.md Enables the configuration of Twitter Card meta tags for rich media content on Twitter. Supports setting card type, title, site, description, URL, and images. Methods are chainable for efficient setup. ```APIDOC TwitterCard: __construct() Initializes the TwitterCard manager. addValue(string $key, string|array $value): self Adds a custom Twitter Card value. Parameters: - key: The property key (e.g., 'twitter:title'). - value: The property value, can be a string or an array. Returns: The current TwitterCard instance for chaining. setType(string $type): self Sets the Twitter Card type (e.g., 'summary', 'photo'). Parameters: - type: The card type. Returns: The current TwitterCard instance for chaining. setTitle(string $title): self Sets the Twitter Card title. Parameters: - title: The title for the card. Returns: The current TwitterCard instance for chaining. setSite(string $site): self Sets the Twitter username for the site. Parameters: - site: The Twitter username of the website. Returns: The current TwitterCard instance for chaining. setDescription(string $description): self Sets the Twitter Card description. Parameters: - description: The description for the card. Returns: The current TwitterCard instance for chaining. setUrl(string $url): self Sets the Twitter Card URL. Parameters: - url: The URL of the content. Returns: The current TwitterCard instance for chaining. setImage(string $url): self Adds a single image URL to the Twitter Card. Parameters: - url: The URL of the image. Returns: The current TwitterCard instance for chaining. generate(): string Generates the HTML meta tags for Twitter Cards. Returns: A string containing the generated HTML. ``` -------------------------------- ### Basic SEOMeta Usage Source: https://github.com/artesaos/seotools/blob/master/README.md Demonstrates how to set the page title and description using the SEOMeta facade. This is a fundamental step for SEO. ```php use Artesaos\SEOTools\Facades\SEOMeta; // ... SEOMeta::setTitle('Your page title'); SEOMeta::setDescription('Your page description.'); ``` -------------------------------- ### Configure SEOTools in Lumen Source: https://github.com/artesaos/seotools/blob/master/README.md For Lumen projects, manually copy the SEOTools configuration file from the package's resources to the project's config directory. ```shell # Copy src/resources/config/seotools.php to config/seotools.php ``` -------------------------------- ### Publish SEOTools Configuration Source: https://github.com/artesaos/seotools/blob/master/README.md Publishes the SEOTools configuration file to your project's config directory using Artisan. For Lumen, manual copying is required. ```shell php artisan vendor:publish # Or specifically for SEOTools: php artisan vendor:publish --provider="Artesaos\SEOTools\Providers\SEOToolsServiceProvider" ``` -------------------------------- ### Basic SEOTools Usage in Laravel Controller Source: https://github.com/artesaos/seotools/blob/master/README.md Demonstrates setting basic SEO meta tags, Open Graph properties, Twitter Card details, and JSON-LD data using individual facades within a Laravel controller. This approach allows for granular control over each SEO aspect. ```php setTitle('Open Graph Title') ->setDescription('Open Graph Description') ->setUrl('http://current.url.com/page') ->addProperty('type', 'article'); SEOTools::twittercard() ->setTitle('Twitter Card Title') ->setDescription('Twitter Card Description') ->setType('summary_large_image'); SEOTools::jsonLd()->add( '@context', 'https://schema.org', '@type', 'WebPage', 'name', 'Your page name' ); // To render all tags in your view: {!! SEO::generate() !!} ``` -------------------------------- ### Consolidated SEOTools Facade Usage Source: https://github.com/artesaos/seotools/blob/master/README.md Illustrates using the unified `SEOTools` facade to set various SEO properties, including Open Graph, Canonical URLs, Twitter Cards, and JSON-LD, in a single chain of calls. This offers a more concise way to manage SEO elements. ```php setUrl('http://current.url.com'); SEOTools::setCanonical('https://codecasts.com.br/lesson'); SEOTools::opengraph()->addProperty('type', 'articles'); SEOTools::twitter()->setSite('@LuizVinicius73'); SEOTools::jsonLd()->addImage('https://codecasts.com.br/img/logo.jpg'); // ... rest of controller logic return view('myindex'); } } ``` -------------------------------- ### OpenGraph Media Addition Source: https://github.com/artesaos/seotools/blob/master/README.md Demonstrates how to add media objects, specifically audio and video, to OpenGraph tags. This includes specifying the media URL, secure URL, and MIME type. ```APIDOC OpenGraph::addVideo('http://example.com/movie.swf', [ 'secure_url' => 'https://example.com/movie.swf', 'type' => 'application/x-shockwave-flash', 'width' => 400, 'height' => 300 ]); OpenGraph::addAudio('http://example.com/sound.mp3', [ 'secure_url' => 'https://secure.example.com/sound.mp3', 'type' => 'audio/mpeg' ]); ``` -------------------------------- ### Configure SEOTools Aliases (Laravel) Source: https://github.com/artesaos/seotools/blob/master/README.md Sets up short aliases for SEOTools facades in Laravel's config/app.php file for easier access to its features. ```php [ 'SEOMeta' => Artesaos\SEOTools\Facades\SEOMeta::class, 'OpenGraph' => Artesaos\SEOTools\Facades\OpenGraph::class, 'Twitter' => Artesaos\SEOTools\Facades\TwitterCard::class, 'JsonLd' => Artesaos\SEOTools\Facades\JsonLd::class, 'JsonLdMulti' => Artesaos\SEOTools\Facades\JsonLdMulti::class, // or 'SEO' => Artesaos\SEOTools\Facades\SEOTools::class, // ... ], // ... ]; ``` -------------------------------- ### JSON-LD Structured Data Source: https://github.com/artesaos/seotools/blob/master/README.md Illustrates how to add JSON-LD structured data to your page using the JsonLd facade, which helps search engines understand content context. ```php use Artesaos\SEOTools\Facades\JsonLd; // ... JsonLd::add( '@context', 'https://schema.org' ); JsonLd::add( '@type', 'WebPage' ); JsonLd::add( 'name', 'Your page name' ); JsonLd::add( 'description', 'Your page description' ); ``` -------------------------------- ### JsonLdMulti for Multiple JSON-LD Schemas Source: https://github.com/artesaos/seotools/blob/master/README.md Demonstrates using the `JsonLdMulti` facade to manage multiple JSON-LD schema objects. It shows how to add data to the current schema and conditionally create new ones, useful for pages with complex structured data requirements. ```php title); JsonLdMulti::setDescription($post->resume); JsonLdMulti::setType('Article'); JsonLdMulti::addImage($post->images->list('url')); if(! JsonLdMulti::isEmpty()) { JsonLdMulti::newJsonLd(); JsonLdMulti::setType('WebPage'); JsonLdMulti::setTitle('Page Article - '.$post->title); } // ... rest of controller logic return view('show', compact('post')); } } ``` -------------------------------- ### Basic SEO Meta Tag Generation Source: https://github.com/artesaos/seotools/blob/master/README.md Demonstrates how to generate various SEO meta tags including SEOMeta, OpenGraph, Twitter Cards, and JSON-LD within an HTML view. It shows options for standard generation, minified output, and usage within Lumen. ```html {!! SEOMeta::generate() !!} {!! OpenGraph::generate() !!} {!! Twitter::generate() !!} {!! JsonLd::generate() !!} // OR with multi {!! JsonLdMulti::generate() !!} {!! SEO::generate() !!} {!! SEO::generate(true) !!} {!! app('seotools')->generate() !!} ``` -------------------------------- ### Generate JSON-LD Schema with PHP Source: https://github.com/artesaos/seotools/blob/master/README.md Facilitates the creation of JSON-LD structured data for SEO. Allows adding key-value pairs, setting schema type, title, description, URL, site name, and images. Supports method chaining for easy configuration. ```APIDOC JsonLd: __construct() Initializes the JsonLd manager. addValue(string $key, string|array $value): self Adds a custom key-value pair to the JSON-LD object. Parameters: - key: The property key (e.g., '@type', 'name'). - value: The property value, can be a string or an array. Returns: The current JsonLd instance for chaining. setType(string $type): self Sets the main type of the JSON-LD schema (e.g., 'Article', 'Product'). Parameters: - type: The schema type. Returns: The current JsonLd instance for chaining. setTitle(string $title): self Sets the title for the JSON-LD schema. Parameters: - title: The title of the content. Returns: The current JsonLd instance for chaining. setSite(string $name): self Sets the site name for the JSON-LD schema. Parameters: - name: The name of the website. Returns: The current JsonLd instance for chaining. setDescription(string $description): self Sets the description for the JSON-LD schema. Parameters: - description: The description of the content. Returns: The current JsonLd instance for chaining. setUrl(string $url): self Sets the URL for the JSON-LD schema. Parameters: - url: The URL of the content. Returns: The current JsonLd instance for chaining. setImage(string $url): self Adds a single image URL to the JSON-LD schema. Parameters: - url: The URL of the image. Returns: The current JsonLd instance for chaining. generate(): string Generates the JSON-LD script tag. Returns: A string containing the generated script tag. ``` -------------------------------- ### OpenGraph Book Schema Configuration Source: https://github.com/artesaos/seotools/blob/master/README.md Demonstrates configuring the Open Graph `book` schema, including properties for author, ISBN, and release date. This is useful for pages featuring books or literary content. ```php setDescription('Some Book') ->setType('book') ->setBook([ 'author' => 'profile / array', 'isbn' => 'string', 'release_date' => 'datetime', 'tag' => 'string / array' ]); // ... rest of controller logic return view('show', compact('post')); } } ``` -------------------------------- ### OpenGraph Profile Schema Configuration Source: https://github.com/artesaos/seotools/blob/master/README.md Illustrates setting up the Open Graph `profile` schema, defining properties for first name, last name, username, and gender. This is ideal for pages representing people or user profiles. ```php setDescription('Some Person') ->setType('profile') ->setProfile([ 'first_name' => 'string', 'last_name' => 'string', 'username' => 'string', 'gender' => 'enum(male, female)' ]); // ... rest of controller logic return view('show', compact('post')); } } ``` -------------------------------- ### OpenGraph Music Song Schema Configuration Source: https://github.com/artesaos/seotools/blob/master/README.md Demonstrates configuring the Open Graph `music.song` schema, specifying properties like duration, album details, and musician. This is used for pages dedicated to individual songs. ```php setMusicSong([ 'duration' => 'integer', 'album' => 'array', 'album:disc' => 'integer', 'album:track' => 'integer', 'musician' => 'array' ]); // ... rest of controller logic return view('show', compact('post')); } } ``` -------------------------------- ### Open Graph Meta Tags Source: https://github.com/artesaos/seotools/blob/master/README.md Shows how to set Open Graph meta tags for social media sharing, including title, description, URL, and image. ```php use Artesaos\SEOTools\Facades\OpenGraph; // ... OpenGraph::setTitle('Your page title'); OpenGraph::setDescription('Your page description.'); OpenGraph::setUrl('http://current.url.com/page') ->addProperty('type', 'article'); OpenGraph::addProperty('image', 'http://current.url.com/image.jpg'); ``` -------------------------------- ### Access All SEO Providers via SEOTools Facade Source: https://github.com/artesaos/seotools/blob/master/README.md The main SEOTools facade provides a unified interface to access and manage all SEO-related functionalities, including OpenGraph, TwitterCard, and JSON-LD. It also allows setting global meta tags like title, description, and canonical URLs. ```APIDOC SEOTools: __construct() Initializes the SEOTools facade. metatags(): string Generates all configured meta tags (OpenGraph, TwitterCard, JSON-LD, etc.). Returns: A string containing all generated meta tags. twitter(): string Generates only the Twitter Card meta tags. Returns: A string containing the Twitter Card meta tags. opengraph(): string Generates only the OpenGraph meta tags. Returns: A string containing the OpenGraph meta tags. jsonLd(): string Generates only the JSON-LD meta tags. Returns: A string containing the JSON-LD meta tags. setTitle(string $title): self Sets the global page title. Parameters: - title: The desired page title. Returns: The SEOTools instance for chaining. getTitle(bool $session = false): string Retrieves the current page title. Parameters: - session: If true, retrieves title from session (if available). Returns: The current page title. setDescription(string $description): self Sets the global page description. Parameters: - description: The desired page description. Returns: The SEOTools instance for chaining. setCanonical(string $url): self Sets the canonical URL for the page. Parameters: - url: The canonical URL. Returns: The SEOTools instance for chaining. addImages(array $urls): self Adds multiple image URLs to be used by various SEO tags (e.g., OpenGraph, TwitterCard). Parameters: - urls: An array of image URLs. Returns: The SEOTools instance for chaining. ``` -------------------------------- ### OpenGraph Music Album Schema Configuration Source: https://github.com/artesaos/seotools/blob/master/README.md Shows how to configure the Open Graph `music.album` schema, linking it to songs and specifying album-related details. This is suitable for pages featuring music albums. ```php setMusicAlbum([ 'song' => 'music.song' ]); // ... rest of controller logic return view('show', compact('post')); } } ``` -------------------------------- ### Multiple JSON-LD Objects Source: https://github.com/artesaos/seotools/blob/master/README.md Shows how to manage multiple JSON-LD objects on a single page using the JsonLdMulti facade, useful for complex content structures. ```php use Artesaos\SEOTools\Facades\JsonLdMulti; // ... JsonLdMulti::add( '@context', 'https://schema.org', '@type', 'Person', 'name', 'Jane Doe', 'url', 'https://example.com/jane' ); JsonLdMulti::add( '@context', 'https://schema.org', '@type', 'Organization', 'name', 'Example Corp', 'url', 'https://example.com' ); ``` -------------------------------- ### Manage OpenGraph Tags with PHP Source: https://github.com/artesaos/seotools/blob/master/README.md Provides methods to add and manage OpenGraph meta tags for social media sharing. Supports adding single or multiple images, setting title, description, URL, and site name. Methods can be chained for concise configuration. ```APIDOC OpenGraph: __construct() Initializes the OpenGraph manager. addProperty(string $key, string|array $value): self Adds a custom OpenGraph property. Parameters: - key: The property key (e.g., 'og:title'). - value: The property value, can be a string or an array. Returns: The current OpenGraph instance for chaining. addImage(string $url): self Adds a single image URL to the OpenGraph tags. Parameters: - url: The URL of the image. Returns: The current OpenGraph instance for chaining. addImages(array $urls): self Adds multiple image URLs to the OpenGraph tags. Parameters: - urls: An array of image URLs. Returns: The current OpenGraph instance for chaining. setTitle(string $title): self Sets the OpenGraph title. Parameters: - title: The title for the page. Returns: The current OpenGraph instance for chaining. setDescription(string $description): self Sets the OpenGraph description. Parameters: - description: The description for the page. Returns: The current OpenGraph instance for chaining. setUrl(string $url): self Sets the OpenGraph URL. Parameters: - url: The canonical URL of the page. Returns: The current OpenGraph instance for chaining. setSiteName(string $name): self Sets the OpenGraph site name. Parameters: - name: The name of the website. Returns: The current OpenGraph instance for chaining. generate(): string Generates the HTML meta tags for OpenGraph. Returns: A string containing the generated HTML. ``` -------------------------------- ### Register SEOTools Service Provider (Lumen) Source: https://github.com/artesaos/seotools/blob/master/README.md Registers the SEOTools service provider in Lumen's bootstrap file to enable the package's functionality. This is done in bootstrap/app.php. ```php register(Artesaos\SEOTools\Providers\SEOToolsServiceProvider::class); // ... return $app; ``` -------------------------------- ### Dynamic SEOTools Usage with Post Data Source: https://github.com/artesaos/seotools/blob/master/README.md Shows how to dynamically set SEO meta tags, Open Graph properties (including multiple images), and JSON-LD data based on a retrieved post object in a Laravel controller. This is crucial for SEO on content-driven pages. ```php title); SEOMeta::setDescription($post->resume); SEOMeta::addMeta('article:published_time', $post->published_date->toW3CString(), 'property'); SEOMeta::addMeta('article:section', $post->category, 'property'); SEOMeta::addKeyword(['key1', 'key2', 'key3']); OpenGraph::setDescription($post->resume); OpenGraph::setTitle($post->title); OpenGraph::setUrl('http://current.url.com'); OpenGraph::addProperty('type', 'article'); OpenGraph::addProperty('locale', 'pt-br'); OpenGraph::addProperty('locale:alternate', ['pt-pt', 'en-us']); OpenGraph::addImage($post->cover->url); OpenGraph::addImage($post->images->list('url')); OpenGraph::addImage(['url' => 'http://image.url.com/cover.jpg', 'size' => 300]); OpenGraph::addImage('http://image.url.com/cover.jpg', ['height' => 300, 'width' => 300]); JsonLd::setTitle($post->title); JsonLd::setDescription($post->resume); JsonLd::setType('Article'); JsonLd::addImage($post->images->list('url')); // ... rest of controller logic return view('show', compact('post')); } } ``` -------------------------------- ### OpenGraph Article Schema Configuration Source: https://github.com/artesaos/seotools/blob/master/README.md Shows how to configure the Open Graph `article` schema, specifying properties like published time, author, section, and tags. This enhances how articles are shared on social media platforms. ```php setDescription('Some Article') ->setType('article') ->setArticle([ 'published_time' => 'datetime', 'modified_time' => 'datetime', 'expiration_time' => 'datetime', 'author' => 'profile / array', 'section' => 'string', 'tag' => 'string / array' ]); // ... rest of controller logic return view('show', compact('post')); } } ``` -------------------------------- ### OpenGraph Place Configuration Source: https://github.com/artesaos/seotools/blob/master/README.md Illustrates how to configure OpenGraph tags for a 'place' type. This involves setting the title, description, type, and specific place-related properties like latitude and longitude. ```APIDOC OpenGraph::setTitle('Place') ->setDescription('Some Place') ->setType('place') ->setPlace([ 'location:latitude' => 'float', 'location:longitude' => 'float', ]); ``` -------------------------------- ### Register SEOTools Service Provider (Laravel) Source: https://github.com/artesaos/seotools/blob/master/README.md Registers the SEOTools service provider in Laravel's configuration file to enable the package's functionality. This is typically done in config/app.php. ```php [ Artesaos\SEOTools\Providers\SEOToolsServiceProvider::class, // ... ], // ... ]; ``` -------------------------------- ### Manage Multiple JSON-LD Schemas with PHP Source: https://github.com/artesaos/seotools/blob/master/README.md Allows managing multiple independent JSON-LD schema objects within a single page. Provides methods to create new schema groups, check emptiness, select groups, and add properties, supporting method chaining for each group. ```APIDOC JsonLdMulti: __construct() Initializes the JsonLdMulti manager. newJsonLd(): self Creates and selects a new JSON-LD group for configuration. Returns: The current JsonLdMulti instance for chaining. isEmpty(): bool Checks if the current JSON-LD group is empty. Returns: True if empty, false otherwise. select(int $index): self Selects an existing JSON-LD group by its index for further editing. Parameters: - index: The zero-based index of the JSON-LD group. Returns: The current JsonLdMulti instance for chaining. addValue(string $key, string|array $value): self Adds a custom key-value pair to the currently selected JSON-LD group. Parameters: - key: The property key. - value: The property value. Returns: The current JsonLdMulti instance for chaining. setType(string $type): self Sets the main type of the currently selected JSON-LD group. Parameters: - type: The schema type. Returns: The current JsonLdMulti instance for chaining. setTitle(string $title): self Sets the title for the currently selected JSON-LD group. Parameters: - title: The title of the content. Returns: The current JsonLdMulti instance for chaining. setSite(string $name): self Sets the site name for the currently selected JSON-LD group. Parameters: - name: The name of the website. Returns: The current JsonLdMulti instance for chaining. setDescription(string $description): self Sets the description for the currently selected JSON-LD group. Parameters: - description: The description of the content. Returns: The current JsonLdMulti instance for chaining. setUrl(string $url): self Sets the URL for the currently selected JSON-LD group. Parameters: - url: The URL of the content. Returns: The current JsonLdMulti instance for chaining. setImage(string $url): self Adds a single image URL to the currently selected JSON-LD group. Parameters: - url: The URL of the image. Returns: The current JsonLdMulti instance for chaining. generate(): string Generates all configured JSON-LD script tags. Returns: A string containing all generated script tags. ``` -------------------------------- ### OpenGraph Type Configuration Source: https://github.com/artesaos/seotools/blob/master/README.md Defines various OpenGraph types and their associated properties using the OpenGraph facade. This includes setting types for music playlists, radio stations, movies, TV shows, and other video content, specifying relevant properties for each. ```APIDOC OpenGraph::setType('music.playlist') ->setMusicPlaylist([ 'song' => 'music.song', 'song:disc' => 'integer', 'song:track' => 'integer', 'creator' => 'profile' ]); OpenGraph::setType('music.radio_station') ->setMusicRadioStation([ 'creator' => 'profile' ]); OpenGraph::setType('video.movie') ->setVideoMovie([ 'actor' => 'profile / array', 'actor:role' => 'string', 'director' => 'profile /array', 'writer' => 'profile / array', 'duration' => 'integer', 'release_date' => 'datetime', 'tag' => 'string / array' ]); OpenGraph::setType('video.episode') ->setVideoEpisode([ 'actor' => 'profile / array', 'actor:role' => 'string', 'director' => 'profile /array', 'writer' => 'profile / array', 'duration' => 'integer', 'release_date' => 'datetime', 'tag' => 'string / array', 'series' => 'video.tv_show' ]); OpenGraph::setType('video.tv_show') ->setVideoTVShow([ 'actor' => 'profile / array', 'actor:role' => 'string', 'director' => 'profile /array', 'writer' => 'profile / array', 'duration' => 'integer', 'release_date' => 'datetime', 'tag' => 'string / array' ]); OpenGraph::setType('video.other') ->setVideoOther([ 'actor' => 'profile / array', 'actor:role' => 'string', 'director' => 'profile /array', 'writer' => 'profile / array', 'duration' => 'integer', 'release_date' => 'datetime', 'tag' => 'string / array' ]); ``` -------------------------------- ### Twitter Card Meta Tags Source: https://github.com/artesaos/seotools/blob/master/README.md Demonstrates setting Twitter Card meta tags for enhanced social sharing on Twitter, including card type, title, description, and image. ```php use Artesaos\SEOTools\Facades\TwitterCard; // ... TwitterCard::setTitle('Your page title'); TwitterCard::setDescription('Your page description.'); TwitterCard::setType('summary_large_image'); TwitterCard::setImage('http://current.url.com/image.jpg'); ``` -------------------------------- ### Render SEO Tags in Blade View Source: https://github.com/artesaos/seotools/blob/master/README.md Shows how to render all generated SEO meta tags within a Blade template using the SEO facade's generate method. ```html {{-- ... other head elements --}} {!! SEO::generate() !!} ``` -------------------------------- ### SEOToolsTrait Usage in Controller Source: https://github.com/artesaos/seotools/blob/master/README.md Shows how to use the SEOToolsTrait within a Laravel controller to manage SEO meta tags. It covers setting the page title, description, OpenGraph URL and type, Twitter site handle, and JSON-LD type. ```php seo()->setTitle('Home'); $this->seo()->setDescription('This is my page description'); $this->seo()->opengraph()->setUrl('http://current.url.com'); $this->seo()->opengraph()->addProperty('type', 'articles'); $this->seo()->twitter()->setSite('@LuizVinicius73'); $this->seo()->jsonLd()->setType('Article'); $posts = Post::all(); return view('myindex', compact('posts')); } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.