### Install Seoquent Package Source: https://github.com/ibrahim-eng12/seoquent/blob/main/README.md This command installs the Seoquent package using Composer. It is the first step to integrating Seoquent into your Laravel project. ```bash composer require ibrahim-eng12/seoquent ``` -------------------------------- ### Complete Blog Post Controller Example with Seoquent (PHP) Source: https://context7.com/ibrahim-eng12/seoquent/llms.txt This PHP code demonstrates a complete controller example for managing blog posts, utilizing the Seoquent package to set various SEO elements. It covers setting global SEO for the index page and dynamic SEO for individual posts, including Open Graph, Twitter cards, JSON-LD, and breadcrumbs. Dependencies include the Post model and the Seoquent facade. ```php description('Read our latest articles on web development, Laravel, and PHP.') ->canonical(route('posts.index')); Seo::openGraph() ->type('website') ->siteName('My Tech Blog'); Seo::twitter() ->site('@mytechblog'); Seo::jsonLd()->website( name: 'My Tech Blog', url: config('app.url'), searchUrl: route('posts.search') . '?q=' ); $posts = Post::published()->latest()->paginate(10); return view('posts.index', compact('posts')); } public function show(Post $post) { // Load database-stored SEO if available $post->applySeo(); // Override or set additional SEO Seo::title($post->title) ->description($post->excerpt) ->canonical(route('posts.show', $post)); Seo::openGraph() ->type('article') ->image($post->featured_image, 1200, 630, $post->title); Seo::twitter() ->site('@mytechblog') ->creator('@' . $post->author->twitter); // Article structured data Seo::jsonLd()->article( title: $post->title, author: $post->author->name, datePublished: $post->published_at->toIso8601String(), dateModified: $post->updated_at->toIso8601String(), image: $post->featured_image, description: $post->excerpt ); // Breadcrumbs Seo::jsonLd()->breadcrumbs([ ['name' => 'Home', 'url' => url('/')], ['name' => 'Blog', 'url' => route('posts.index')], ['name' => $post->category->name, 'url' => route('categories.show', $post->category)], ['name' => $post->title], ]); return view('posts.show', compact('post')); } } ``` -------------------------------- ### Seoquent Basic SEO API Methods Source: https://github.com/ibrahim-eng12/seoquent/blob/main/README.md Provides examples of using Seoquent's fluent API to set various basic SEO properties such as title, description, keywords, image, canonical URL, author, and robots directives. ```php Seo::title('Page Title'); Seo::description('Page description'); Seo::keywords(['keyword1', 'keyword2']); Seo::image('https://example.com/image.jpg'); Seo::canonical('https://example.com/page'); Seo::author('Ibrahim'); Seo::robots('index, follow'); Seo::noIndex(); ``` -------------------------------- ### Example SEO Meta Tags Rendered by Seoquent Source: https://github.com/ibrahim-eng12/seoquent/blob/main/README.md Illustrates the HTML output generated by Seoquent after setting basic SEO properties. This includes title, meta description, canonical, Open Graph, and Twitter Card tags. ```html My Post Title | App Name ``` -------------------------------- ### Configure Twitter Cards with Seoquent in PHP Source: https://context7.com/ibrahim-eng12/seoquent/llms.txt This snippet demonstrates how to configure Twitter Card meta tags using the Seoquent facade in PHP. It covers full customization, quick setters for card types, and an example of integrating Twitter tags with other social tags within a controller. It falls back to Open Graph and meta tags if Twitter-specific values are not set. ```php use IbrahimEng12\Seoquent\Facades\Seo; // Full Twitter Card customization Seo::twitter() ->card('summary_large_image') // summary, summary_large_image, app, player ->site('@mycompany') // Your site's Twitter handle ->creator('@authorhandle') // Content creator's handle ->title('Custom Twitter Title') ->description('Custom Twitter description for this content') ->image('https://example.com/twitter-card.jpg', 'Image alt text'); // Quick card type setters Seo::twitter()->summary(); // Small image card Seo::twitter()->summaryLargeImage(); // Large image card (default) // Complete controller example with all social tags public function show(Post $post) { Seo::title($post->title) ->description($post->excerpt) ->image($post->cover_image); Seo::openGraph() ->type('article') ->siteName('My Blog'); Seo::twitter() ->site('@myblog') ->creator('@' . $post->author->twitter_handle); return view('posts.show', compact('post')); } // Rendered Twitter output: // // // // // // ``` -------------------------------- ### Configure Open Graph Tags in Laravel Source: https://context7.com/ibrahim-eng12/seoquent/llms.txt Set Open Graph meta tags for enhanced social media sharing. The package automatically falls back to basic meta tags if Open Graph specifics are not provided. Supports customization of title, description, type, URL, site name, locale, and images. ```php use IbrahimEng12\Seoquent\Facades\Seo; // Basic usage - Open Graph inherits from meta tags Seo::title('My Article') ->description('Article description') ->image('https://example.com/article-cover.jpg', 1200, 630, 'Article cover image'); // Full Open Graph customization Seo::openGraph() ->title('Custom Social Title') // Override meta title ->description('Custom social description') ->type('article') // website, article, profile, etc. ->url('https://example.com/article/123') ->siteName('My Awesome Site') ->locale('en_US') ->image('https://example.com/og-image.jpg', 1200, 630, 'Alt text for image'); // Quick type setters Seo::openGraph()->article(); // Sets type to 'article' Seo::openGraph()->profile(); // Sets type to 'profile' // Add custom Open Graph properties Seo::openGraph()->property('article:author', 'https://facebook.com/author'); Seo::openGraph()->property('article:published_time', '2025-01-15T08:00:00+00:00'); // Rendered output: // // // // // // // // // // ``` -------------------------------- ### Generate XML Sitemaps with Seoquent Source: https://context7.com/ibrahim-eng12/seoquent/llms.txt This snippet demonstrates how to generate XML sitemaps using the Seoquent package. It covers adding static URLs and dynamically generating URLs from Eloquent models. Sitemaps are cached and served at /sitemap.xml. Ensure the Seoquent facade is imported. ```php // In AppServiceProvider.php boot() method use IbrahimEng12\Seoquent\Facades\Seo; public function boot() { // Add static pages Seo::sitemap() ->add(url('/'), now()->toIso8601String(), 'daily', 1.0) ->add(url('/about'), null, 'monthly', 0.8) ->add(url('/contact'), null, 'monthly', 0.6) ->add(url('/blog'), now()->toIso8601String(), 'daily', 0.9); // Add URLs from Eloquent models Seo::sitemap()->addModel( modelClass: \App\Models\Post::class, routeName: 'posts.show', // Named route to generate URLs routeKey: 'slug', // Model attribute for route parameter lastmodColumn: 'updated_at', // Column for lastmod (null to disable) changefreq: 'weekly', priority: 0.8, queryCallback: fn ($query) => $query->where('published', true)->where('status', 'active') ); // Add products with custom query Seo::sitemap()->addModel( modelClass: \App\Models\Product::class, routeName: 'products.show', routeKey: 'id', changefreq: 'daily', priority: 0.7, queryCallback: fn ($query) => $query->where('in_stock', true) ); // Add categories Seo::sitemap()->addModel( modelClass: \App\Models\Category::class, routeName: 'categories.show', routeKey: 'slug', changefreq: 'weekly', priority: 0.6 ); } // Clear sitemap cache when content changes Seo::sitemap()->clearCache(); // Sitemap is served at: https://yoursite.com/sitemap.xml // Generated XML format: // // // // https://yoursite.com/ // 2025-01-15T10:00:00+00:00 // daily // 1.0 // // ... // ``` -------------------------------- ### Load SEO Settings from Array in PHP Source: https://context7.com/ibrahim-eng12/seoquent/llms.txt This snippet demonstrates how to load SEO settings from an array into the SEOquent facade. It's useful for populating SEO data from sources like database records or API responses. The `fromArray` method accepts an associative array of SEO properties. ```php use IbrahimEng12\Seoquent\Facades\Seo; // Load SEO data from array $seoData = [ 'title' => 'Page Title', 'description' => 'Page description for search engines', 'keywords' => ['keyword1', 'keyword2'], 'canonical' => 'https://example.com/page', 'robots' => 'index, follow', 'author' => 'Author Name', 'image' => 'https://example.com/image.jpg', 'og_type' => 'article', 'twitter_card' => 'summary_large_image', ]; Seo::fromArray($seoData); // Useful for CMS or admin panel integrations public function show($slug) { $page = Page::where('slug', $slug)->firstOrFail(); Seo::fromArray([ 'title' => $page->seo_title ?: $page->title, 'description' => $page->seo_description ?: $page->excerpt, 'image' => $page->featured_image, 'og_type' => 'article', ]); return view('pages.show', compact('page')); } ``` -------------------------------- ### Publish Seoquent Assets using Artisan Source: https://github.com/ibrahim-eng12/seoquent/blob/main/README.md Provides Artisan commands to publish the package's configuration file, database migrations, and Blade views. This allows for customization and integration into your Laravel project. ```bash php artisan vendor:publish --tag=seoquent-config # Config php artisan vendor:publish --tag=seoquent-migrations # Migration php artisan vendor:publish --tag=seoquent-views # Blade views ``` -------------------------------- ### Configure Seoquent Package Settings Source: https://github.com/ibrahim-eng12/seoquent/blob/main/README.md Allows customization of default SEO settings, including title formats, Open Graph properties, Twitter Card defaults, sitemap behavior, robots directives, and database settings. Configuration is managed via the `config/seoquent.php` file, which can be published using an Artisan command. ```bash php artisan vendor:publish --tag=seoquent-config ``` ```php 'defaults' => [ 'title' => env('APP_NAME', 'Laravel'), 'title_separator' => ' | ', 'title_suffix' => env('APP_NAME', 'Laravel'), 'description' => '', 'robots' => 'index, follow', ], 'open_graph' => [ 'type' => 'website', 'site_name' => env('APP_NAME'), 'image' => null, // default OG image for all pages ], 'twitter' => [ 'card' => 'summary_large_image', 'site' => null, // @username 'creator' => null, // @username ], 'sitemap' => [ 'enabled' => true, 'cache_enabled' => true, 'cache_duration' => 3600, ], 'robots' => [ 'enabled' => true, 'allow' => ['/'], 'disallow' => [], ], 'database' => [ 'enabled' => true, 'table_name' => 'seo_meta', ], ``` -------------------------------- ### Set SEO in Controller with Seoquent Source: https://github.com/ibrahim-eng12/seoquent/blob/main/README.md Demonstrates how to set SEO properties like title, description, and image within a Laravel controller using the Seoquent facade. This is part of the '3 Steps to Full SEO' integration. ```php use IbrahimEng12\Seoquent\Facades\Seo; public function show(Post $post) { Seo::title($post->title) ->description($post->excerpt) ->image($post->cover_image); return view('posts.show', compact('post')); } ``` -------------------------------- ### Generate XML Sitemap in PHP Source: https://github.com/ibrahim-eng12/seoquent/blob/main/README.md Allows the creation of an XML sitemap. URLs can be added statically with details like last modification, change frequency, and priority, or dynamically from Eloquent models. The sitemap is served at `/sitemap.xml` and is cached by default. ```php use IbrahimEng12SeoquentFacadesSeo; // Static pages Seo::sitemap() ->add(url('/'), now()->toIso8601String(), 'daily', 1.0) ->add(url('/about'), null, 'monthly', 0.8); // From Eloquent models (auto-generates URLs) Seo::sitemap()->addModel( modelClass: \App\Models\Post::class, routeName: 'posts.show', routeKey: 'slug', changefreq: 'weekly', priority: 0.8, queryCallback: fn ($query) => $query->where('published', true), ); ``` -------------------------------- ### Manage Per-Model SEO Data in PHP Source: https://github.com/ibrahim-eng12/seoquent/blob/main/README.md Enables storing and applying SEO data directly to Eloquent models. This involves publishing migrations, adding the `HasSeo` trait to your model, and using methods like `setSeo`, `applySeo`, and `deleteSeo` to manage SEO content such as title, description, and OG image. ```bash php artisan vendor:publish --tag=seoquent-migrations php artisan migrate ``` ```php use IbrahimEng12\Seoquent\Traits\HasSeo; class Post extends Model { use HasSeo; } ``` ```php $post->setSeo([ 'title' => 'Custom SEO Title', 'description' => 'Custom description', 'og_image' => 'https://example.com/image.jpg', 'keywords' => ['laravel', 'seo'], ]); ``` ```php public function show(Post $post) { $post->applySeo(); // loads all stored SEO data into Seoquent return view('posts.show', compact('post')); } ``` ```php $post->deleteSeo(); ``` -------------------------------- ### Customize Page Title Formatting in Laravel Source: https://context7.com/ibrahim-eng12/seoquent/llms.txt Control how page titles are constructed, including separators, suffixes, and programmatic access to title components. This allows for flexible title formatting to match branding or specific page requirements. ```php use IbrahimEng12\Seoquent\Facades\Seo; // Default: "Page Title | App Name" Seo::title('About Us'); // Change separator: "About Us - My Company" Seo::title('About Us'); Seo::meta()->titleSeparator(' - '); // Remove suffix entirely: "About Us" Seo::title('About Us'); Seo::meta()->withoutTitleSuffix(); // Custom suffix: "About Us | My Company" Seo::title('About Us'); Seo::meta()->titleSuffix('My Company'); // Access title values programmatically $title = Seo::meta()->getTitle(); // "About Us" $fullTitle = Seo::meta()->getFullTitle(); // "About Us | App Name" ``` -------------------------------- ### Render SEO Meta Tags in Blade Templates Source: https://github.com/ibrahim-eng12/seoquent/blob/main/README.md Provides Blade directives and components for rendering SEO-related tags in your HTML views. `@seoHead` renders meta tags, Open Graph, and Twitter Cards, while `@seoJsonLd` renders structured data. Alternatively, use `` and `` components. ```html @seoHead {{-- meta + open graph + twitter cards --}} @seoJsonLd {{-- JSON-LD structured data --}} ``` ```html ``` -------------------------------- ### Seoquent Chained SEO API Calls Source: https://github.com/ibrahim-eng12/seoquent/blob/main/README.md Demonstrates the chainable nature of Seoquent's API, allowing multiple SEO properties to be set in a single, readable statement. This enhances code conciseness. ```php Seo::title('About Us') ->description('Learn more about our company') ->keywords('company, about, team') ->image('https://example.com/about.jpg') ->author('Ibrahim'); ``` -------------------------------- ### Per-Model SEO with HasSeo Trait Source: https://context7.com/ibrahim-eng12/seoquent/llms.txt This snippet shows how to implement per-model SEO customization using the HasSeo trait in Eloquent models. It covers publishing migrations, adding the trait to models, saving and applying SEO data, and accessing/deleting it. This allows editors to customize SEO without code changes. ```php // 1. Publish and run migrations // php artisan vendor:publish --tag=seoquent-migrations // php artisan migrate // 2. Add trait to your model use IbrahimEng12\Seoquent\Traits\HasSeo; class Post extends Model { use HasSeo; } class Product extends Model { use HasSeo; } // 3. Save SEO data for a model $post = Post::find(1); $post->setSeo([ 'title' => 'Custom SEO Title for This Post', 'description' => 'Custom meta description optimized for search', 'keywords' => ['laravel', 'tutorial', 'seo'], 'canonical' => 'https://example.com/posts/original-post', 'robots' => 'index, follow', 'author' => 'Ibrahim', 'og_title' => 'Share Title for Facebook', 'og_description' => 'Description shown when shared on social media', 'og_type' => 'article', 'og_image' => 'https://example.com/social-image.jpg', 'twitter_card' => 'summary_large_image', 'twitter_title' => 'Tweet This Post', 'twitter_image' => 'https://example.com/twitter-image.jpg', ]); // 4. Apply stored SEO in controller public function show(Post $post) { $post->applySeo(); // Loads all stored SEO data into Seoquent return view('posts.show', compact('post')); } // 5. Access SEO data directly $seoData = $post->getSeo(); // Returns SeoMeta model or null $seoArray = $post->getSeo()?->toSeoArray(); // Returns array of non-null values // 6. Delete SEO data $post->deleteSeo(); // 7. Save with custom JSON-LD schemas $product->setSeo([ 'title' => $product->name, 'description' => $product->short_description, 'json_ld' => [ [ '@context' => 'https://schema.org', '@type' => 'Product', 'name' => $product->name, 'offers' => ['@type' => 'Offer', 'price' => $product->price] ] ], 'custom_meta' => [ 'product:price:amount' => $product->price, 'product:price:currency' => 'USD' ] ]); ``` -------------------------------- ### Set Basic SEO Meta Tags in Laravel Source: https://context7.com/ibrahim-eng12/seoquent/llms.txt Configure fundamental page meta tags like title, description, keywords, author, canonical URL, and robots directives using the chainable Seo facade. Values are automatically HTML-escaped. This method is suitable for setting standard SEO elements for any page. ```php use IbrahimEng12\Seoquent\Facades\Seo; // Set all basic meta tags in a single chain Seo::title('Complete Guide to Laravel SEO') ->description('Learn how to implement comprehensive SEO in your Laravel application with Seoquent.') ->keywords(['laravel', 'seo', 'meta-tags', 'open-graph']) ->author('Ibrahim') ->canonical('https://example.com/guides/laravel-seo') ->robots('index, follow'); // For pages that shouldn't be indexed Seo::title('Admin Dashboard') ->description('Internal admin panel') ->noIndex(); // Sets robots to "noindex, nofollow" // In your Blade layout (resources/views/layouts/app.blade.php) // // @seoHead // // Rendered output: // Complete Guide to Laravel SEO | App Name // // // // // ``` -------------------------------- ### Generate JSON-LD Structured Data in PHP Source: https://github.com/ibrahim-eng12/seoquent/blob/main/README.md Provides methods to generate various types of JSON-LD structured data for SEO. Supported types include Article, Organization, Breadcrumbs, FAQ, Product, Local Business, and Website with search actions. It also allows adding custom schemas. Ensure `@seoJsonLd` is added to your layout before the closing `` tag. ```php // Article Seo::jsonLd()->article( title: 'My Article', author: 'Ibrahim', datePublished: '2025-01-01', dateModified: '2025-01-15', image: 'https://example.com/article.jpg', ); // Organization Seo::jsonLd()->organization('Company Name', 'https://example.com', 'https://example.com/logo.png'); // Breadcrumbs Seo::jsonLd()->breadcrumbs([ ['name' => 'Home', 'url' => '/'], ['name' => 'Blog', 'url' => '/blog'], ['name' => 'Current Post'], ]); // FAQ Seo::jsonLd()->faq([ ['question' => 'What is this?', 'answer' => 'A Laravel SEO package.'], ['question' => 'Is it free?', 'answer' => 'Yes, MIT licensed.'], ]); // Product Seo::jsonLd()->product( name: 'Product Name', description: 'Description', brand: 'Brand', price: 29.99, currency: 'USD', availability: 'InStock', ); // Local Business Seo::jsonLd()->localBusiness( name: 'My Business', address: '123 Main St', phone: '+1234567890', ); // Website with search action Seo::jsonLd()->website('My Site', 'https://example.com', 'https://example.com/search?q='); // Any custom schema Seo::jsonLd()->addSchema([ '@context' => 'https://schema.org', '@type' => 'Event', 'name' => 'My Event', 'startDate' => '2025-06-01', ]); ``` -------------------------------- ### Implement JSON-LD Structured Data with Seoquent in PHP Source: https://context7.com/ibrahim-eng12/seoquent/llms.txt This snippet illustrates how to add Schema.org structured data using the Seoquent facade in PHP. It showcases various schema types including Article, Organization, Website with search, Breadcrumbs, FAQ, Product, LocalBusiness, and custom schemas. The structured data is typically rendered using Blade directives like `@seoJsonLd` or `@seoHead`. ```php use IbrahimEng12\Seoquent\Facades\Seo; // Article schema for blog posts Seo::jsonLd()->article( title: 'How to Implement SEO in Laravel', author: 'Ibrahim', datePublished: '2025-01-15T10:00:00+00:00', dateModified: '2025-01-20T14:30:00+00:00', image: 'https://example.com/article-image.jpg', description: 'A comprehensive guide to Laravel SEO' ); // Organization schema Seo::jsonLd()->organization( name: 'My Company', url: 'https://example.com', logo: 'https://example.com/logo.png' ); // Website with search action Seo::jsonLd()->website( name: 'My Site', url: 'https://example.com', searchUrl: 'https://example.com/search?q=' ); // Breadcrumbs for navigation Seo::jsonLd()->breadcrumbs([ ['name' => 'Home', 'url' => 'https://example.com/'], ['name' => 'Blog', 'url' => 'https://example.com/blog'], ['name' => 'Laravel SEO Guide'], // Current page (no url) ]); // FAQ page schema Seo::jsonLd()->faq([ ['question' => 'What is Seoquent?', 'answer' => 'An all-in-one Laravel SEO package.'], ['question' => 'Is Seoquent free?', 'answer' => 'Yes, it is MIT licensed.'], ['question' => 'Which Laravel versions are supported?', 'answer' => 'Laravel 10, 11, and 12.'], ]); // Product schema for e-commerce Seo::jsonLd()->product( name: 'Premium Laravel Course', description: 'Master Laravel development with this comprehensive course', image: 'https://example.com/course-cover.jpg', brand: 'CodeAcademy', sku: 'LARAVEL-COURSE-001', price: 99.99, currency: 'USD', availability: 'InStock' // InStock, OutOfStock, PreOrder ); // Local business schema Seo::jsonLd()->localBusiness( name: 'My Tech Shop', address: '123 Main Street, New York, NY 10001', phone: '+1-555-123-4567', url: 'https://mytechshop.com', image: 'https://mytechshop.com/storefront.jpg', openingHours: ['Mo-Fr 09:00-18:00', 'Sa 10:00-16:00'] ); // Custom schema for any Schema.org type Seo::jsonLd()->addSchema([ '@context' => 'https://schema.org', '@type' => 'Event', 'name' => 'Laravel Conference 2025', 'startDate' => '2025-06-15T09:00:00-05:00', 'endDate' => '2025-06-17T17:00:00-05:00', 'location' => [ '@type' => 'Place', 'name' => 'Convention Center', 'address' => '456 Tech Boulevard' ] ]); // Add @seoJsonLd to layout (before ) or use @seoHead which includes it // // ... // @seoJsonLd // ``` -------------------------------- ### Add Custom Meta Tags in PHP Source: https://context7.com/ibrahim-eng12/seoquent/llms.txt This snippet shows how to add arbitrary meta tags using SEOquent's `meta()` method. This is useful for tags not explicitly supported by the package's built-in methods, such as `viewport` or custom verification tags. The method can be chained to add multiple meta tags. ```php use IbrahimEng12\Seoquent\Facades\Seo; // Add custom meta tags Seo::meta() ->meta('viewport', 'width=device-width, initial-scale=1') ->meta('theme-color', '#3b82f6') ->meta('apple-mobile-web-app-capable', 'yes') ->meta('apple-mobile-web-app-status-bar-style', 'black-translucent') ->meta('format-detection', 'telephone=no') ->meta('google-site-verification', 'your-verification-code') ->meta('msvalidate.01', 'your-bing-verification-code'); // Rendered output: // // // ``` -------------------------------- ### Seoquent Configuration File Source: https://context7.com/ibrahim-eng12/seoquent/llms.txt This snippet displays the default configuration file for SEOquent. It allows customization of various SEO properties like titles, descriptions, keywords, Open Graph settings, Twitter cards, JSON-LD, sitemap, robots.txt, and database integration. Publish this file using `php artisan vendor:publish --tag=seoquent-config` to modify settings. ```php // Publish config: php artisan vendor:publish --tag=seoquent-config // File: config/seoquent.php return [ 'defaults' => [ 'title' => env('APP_NAME', 'Laravel'), 'title_separator' => ' | ', 'title_suffix' => env('APP_NAME', 'Laravel'), 'description' => 'Default site description', 'keywords' => [], 'robots' => 'index, follow', 'canonical' => null, 'author' => '', ], 'open_graph' => [ 'type' => 'website', 'site_name' => env('APP_NAME', 'Laravel'), 'locale' => 'en_US', 'image' => 'https://example.com/default-og-image.jpg', 'image_width' => 1200, 'image_height' => 630, ], 'twitter' => [ 'card' => 'summary_large_image', 'site' => '@yoursite', // Your site's Twitter handle 'creator' => null, // Default content creator ], 'json_ld' => [ 'enabled' => true, 'organization' => [ 'name' => env('APP_NAME', 'Laravel'), 'url' => env('APP_URL', 'http://localhost'), 'logo' => 'https://example.com/logo.png', ], ], 'sitemap' => [ 'enabled' => true, 'route' => 'sitemap.xml', 'cache_enabled' => true, 'cache_duration' => 3600, 'default_frequency' => 'weekly', 'default_priority' => 0.5, 'max_urls' => 50000, ], 'robots' => [ 'enabled' => true, 'route' => 'robots.txt', 'allow' => ['/'], 'disallow' => ['/admin', '/api', '/private'], 'sitemap_url' => null, // Auto-generated if null ], 'database' => [ 'enabled' => true, 'table_name' => 'seo_meta', ], 'trailing_slash' => null, // null, true (add), or false (remove) ]; ``` -------------------------------- ### Render SEO Head Tags with Seoquent Blade Directive Source: https://github.com/ibrahim-eng12/seoquent/blob/main/README.md Shows how to include the Seoquent Blade directive `@seoHead` in your main layout file to render all generated SEO meta tags. This is the second step in integrating Seoquent. ```html @seoHead ``` -------------------------------- ### Seoquent Open Graph API Customization Source: https://github.com/ibrahim-eng12/seoquent/blob/main/README.md Shows how to manually override or set specific Open Graph meta tags using Seoquent's API. It supports customizing title, description, type, image (with dimensions and alt text), site name, and locale. ```php Seo::openGraph() ->title('Custom OG Title') ->description('Custom OG Description') ->type('article') ->image('https://example.com/og.jpg', 1200, 630, 'Alt text') ->siteName('My Site') ->locale('en_US'); ``` -------------------------------- ### Render SEO Tags in Blade Views Source: https://context7.com/ibrahim-eng12/seoquent/llms.txt This snippet illustrates how to render SEO tags within Blade views using SEOquent's directives or components. `@seoHead` renders all necessary meta, Open Graph, and Twitter Card tags, while `@seoJsonLd` renders structured data. Alternatively, you can programmatically retrieve the HTML strings in a controller. ```html @seoHead {{-- Renders meta, Open Graph, Twitter Cards, and JSON-LD --}} @yield('content') {{-- Or render JSON-LD separately at bottom of body --}} @seoJsonLd {{-- Meta, Open Graph, Twitter Cards --}} {{-- JSON-LD structured data --}} @yield('content') $headHtml, 'seoJsonLd' => $jsonLdHtml, ]); ?> ``` -------------------------------- ### Set Twitter Card Meta Tags in PHP Source: https://github.com/ibrahim-eng12/seoquent/blob/main/README.md Configures Twitter Card meta tags for social sharing. It falls back to Open Graph and then standard meta tags if not explicitly set. This method allows customization of the card type, site handle, creator handle, title, and image with alt text. ```php Seo::twitter() ->card('summary_large_image') ->site('@mysite') ->creator('@author') ->title('Custom Twitter Title') ->image('https://example.com/twitter.jpg', 'Alt text'); ``` -------------------------------- ### Seoquent Title Customization API Source: https://github.com/ibrahim-eng12/seoquent/blob/main/README.md Explains how to customize the page title output, including removing the default site name suffix and changing the separator between the page title and site name. ```php // Default output: "Page Title | App Name" Seo::title('Page Title'); // Remove suffix: "Page Title" Seo::meta()->withoutTitleSuffix(); // Change separator: "Page Title - App Name" Seo::meta()->titleSeparator(' - '); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.