{"id":27145458,"url":"https://github.com/elegantengineeringtech/laravel-seo","last_synced_at":"2026-01-25T13:04:44.919Z","repository":{"id":254303955,"uuid":"845966143","full_name":"ElegantEngineeringTech/laravel-seo","owner":"ElegantEngineeringTech","description":"An Elegant \u0026 Flexible SEO Tag Builder for Laravel","archived":false,"fork":false,"pushed_at":"2026-01-18T16:59:25.000Z","size":123,"stargazers_count":12,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-19T00:54:07.564Z","etag":null,"topics":["laravel","laravel-package","laravel-seo","opengraph","php","schema-org","seo"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ElegantEngineeringTech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"ElegantEngineeringTech"}},"created_at":"2024-08-22T09:24:21.000Z","updated_at":"2026-01-18T16:59:29.000Z","dependencies_parsed_at":"2024-08-22T17:35:55.553Z","dependency_job_id":"68d53ad1-5934-4352-8ac5-51ba748ef0fa","html_url":"https://github.com/ElegantEngineeringTech/laravel-seo","commit_stats":null,"previous_names":["elegantengineeringtech/laravel-seo"],"tags_count":19,"template":false,"template_full_name":"spatie/package-skeleton-laravel","purl":"pkg:github/ElegantEngineeringTech/laravel-seo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElegantEngineeringTech%2Flaravel-seo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElegantEngineeringTech%2Flaravel-seo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElegantEngineeringTech%2Flaravel-seo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElegantEngineeringTech%2Flaravel-seo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ElegantEngineeringTech","download_url":"https://codeload.github.com/ElegantEngineeringTech/laravel-seo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElegantEngineeringTech%2Flaravel-seo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28753411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T10:25:12.305Z","status":"ssl_error","status_checked_at":"2026-01-25T10:25:11.933Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","laravel-package","laravel-seo","opengraph","php","schema-org","seo"],"created_at":"2025-04-08T09:48:35.637Z","updated_at":"2026-01-25T13:04:44.898Z","avatar_url":"https://github.com/ElegantEngineeringTech.png","language":"PHP","funding_links":["https://github.com/sponsors/ElegantEngineeringTech"],"categories":[],"sub_categories":[],"readme":"# An Elegant \u0026 Flexible SEO Tag Builder for Laravel\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/elegantly/laravel-seo.svg?style=flat-square)](https://packagist.org/packages/elegantly/laravel-seo)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/ElegantEngineeringTech/laravel-seo/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/ElegantEngineeringTech/laravel-seo/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/ElegantEngineeringTech/laravel-seo/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/ElegantEngineeringTech/laravel-seo/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/elegantly/laravel-seo.svg?style=flat-square)](https://packagist.org/packages/elegantly/laravel-seo)\n\n![laravel-seo](https://repository-images.githubusercontent.com/845966143/6ff7437c-852d-41eb-8b2f-927551506a13)\n\n## Introduction\n\n`laravel-seo` is a flexible and powerful package for managing SEO tags in Laravel applications.\n\nWith this package, you can easily handle:\n\n-   Standard HTML tags like `\u003ctitle\u003e` and `\u003cmeta name=\"robots\"\u003e`\n-   Localization with alternate tags ([Google SEO Localization](https://developers.google.com/search/docs/specialty/international/localized-versions))\n-   [Open Graph tags](https://ogp.me/) with structured properties, arrays, and object types\n-   [Twitter (X) tags](https://developer.x.com/en/docs/x-for-websites/cards/overview/abouts-cards)\n-   [Structured data (JSON-LD)](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data)\n\n## Installation\n\nYou can install the package via Composer:\n\n```bash\ncomposer require elegantly/laravel-seo\n```\n\nNext, publish the config file:\n\n```bash\nphp artisan vendor:publish --tag=\"seo-config\"\n```\n\n### Config File Overview\n\nThe configuration file (`config/seo.php`) allows you to customize the default SEO behavior for your application. Here's a snippet with all available settings:\n\n```php\nreturn [\n\n    'defaults' =\u003e [\n        /*\n        |--------------------------------------------------------------------------\n        | Default Title\n        |--------------------------------------------------------------------------\n        |\n        | This is the default value used for \u003ctitle\u003e, \"og:title\", \"twitter:title\"\n        |\n        */\n        'title' =\u003e env('APP_NAME', 'Laravel'),\n\n        /*\n        |--------------------------------------------------------------------------\n        | Default Description\n        |--------------------------------------------------------------------------\n        |\n        | This is the default value used for \u003cmeta name=\"description\"\u003e,\n        | \u003cmeta property=\"og:description\"\u003e, \u003cmeta name=\"twitter:description\"\u003e\n        |\n        */\n        'description' =\u003e null,\n\n        /*\n        |--------------------------------------------------------------------------\n        | Default Author\n        |--------------------------------------------------------------------------\n        |\n        | This is the default value used for \u003cmeta name=\"author\"\u003e\n        |\n        */\n        'author' =\u003e null,\n\n        /*\n        |--------------------------------------------------------------------------\n        | Default Generator\n        |--------------------------------------------------------------------------\n        |\n        | This is the default value used for \u003cmeta name=\"generator\"\u003e\n        |\n        */\n        'generator' =\u003e null,\n\n        /*\n        |--------------------------------------------------------------------------\n        | Default Keywords\n        |--------------------------------------------------------------------------\n        |\n        | This is the default value used for \u003cmeta name=\"keywords\"\u003e\n        | Types supported: string or array of strings\n        |\n        */\n        'keywords' =\u003e null,\n\n        /*\n        |--------------------------------------------------------------------------\n        | Default Referrer\n        |--------------------------------------------------------------------------\n        |\n        | This is the default value used for \u003cmeta name=\"referrer\"\u003e\n        |\n        */\n        'referrer' =\u003e null,\n\n        /*\n        |--------------------------------------------------------------------------\n        | Default Theme color\n        |--------------------------------------------------------------------------\n        |\n        | This is the default value used for \u003cmeta name=\"theme-color\"\u003e\n        |\n        */\n        'theme-color' =\u003e null,\n\n        /*\n        |--------------------------------------------------------------------------\n        | Default Color Scheme\n        |--------------------------------------------------------------------------\n        |\n        | This is the default value used for \u003cmeta name=\"color-scheme\"\u003e\n        |\n        */\n        'color-scheme' =\u003e null,\n\n        /*\n        |--------------------------------------------------------------------------\n        | Default Image path\n        |--------------------------------------------------------------------------\n        |\n        | This is the default value used for \u003cmeta property=\"og:image\"\u003e, \u003cmeta name=\"twitter:image\"\u003e\n        | You can use relative path like \"/opengraph.png\" or url like \"https://example.com/opengraph.png\"\n        |\n        */\n        'image' =\u003e null,\n\n        /*\n        |--------------------------------------------------------------------------\n        | Default Robots\n        |--------------------------------------------------------------------------\n        |\n        | This is the default value used for \u003cmeta name=\"robots\"\u003e\n        | See Google documentation here: https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag?hl=fr#directives\n        |\n        */\n        'robots' =\u003e 'max-snippet:-1,max-image-preview:large,max-video-preview:-1',\n\n        /*\n        |--------------------------------------------------------------------------\n        | Default Sitemap path\n        |--------------------------------------------------------------------------\n        |\n        | This is the default value used for \u003clink rel=\"sitemap\"\u003e\n        | You can use relative path like \"/sitemap.xml\" or url like \"https://example.com/sitemap.xml\"\n        |\n        */\n        'sitemap' =\u003e null,\n    ],\n\n    /**\n     * @see https://ogp.me/\n     */\n    'opengraph' =\u003e [\n        /*\n        |--------------------------------------------------------------------------\n        | Default Site Name\n        |--------------------------------------------------------------------------\n        |\n        | This is the default value used for \u003cmeta property=\"og:site_name\" /\u003e\n        | If null: config('app.name') is used.\n        |\n        */\n        'site_name' =\u003e null,\n\n        /*\n        |--------------------------------------------------------------------------\n        | Default Determiner\n        |--------------------------------------------------------------------------\n        |\n        | This is the default value used for \u003cmeta property=\"og:determiner\" /\u003e\n        | Possible values are: a, an, the, \"\", auto\n        |\n        */\n        'determiner' =\u003e '',\n    ],\n\n    /**\n     * @see https://developer.x.com/en/docs/x-for-websites/cards/overview/abouts-cards\n     */\n    'twitter' =\u003e [\n        /*\n        |--------------------------------------------------------------------------\n        | Default Twitter username\n        |--------------------------------------------------------------------------\n        |\n        | This is the default value used for \u003cmeta name=\"twitter:site\" /\u003e\n        | Example: @X\n        |\n        */\n        'site' =\u003e null,\n    ],\n\n    /**\n     * @see https://schema.org/WebPage\n     */\n    'schema' =\u003e [\n        /*\n        |--------------------------------------------------------------------------\n        | Default WebPage schema\n        |--------------------------------------------------------------------------\n        |\n        | This is the default value used for the schema WebPage\n        | @see https://schema.org/WebPage for all available properties\n        |\n        */\n        'webpage' =\u003e [],\n    ],\n\n];\n```\n\n## Usage\n\n### Displaying SEO Tags\n\nYou can easily render all SEO tags in your Blade views by calling the `seo()` helper function:\n\n```php\n\u003chead\u003e\n    {!! seo() !!}\n\u003c/head\u003e\n```\n\nThis will render all the default tags, for example:\n\n```html\n\u003ctitle\u003eHome\u003c/title\u003e\n\u003cmeta\n    name=\"robots\"\n    content=\"max-snippet:-1,max-image-preview:large,max-video-preview:-1\"\n/\u003e\n\u003clink rel=\"canonical\" href=\"https://example.com\" /\u003e\n\u003c!-- Open Graph --\u003e\n\u003cmeta property=\"og:title\" content=\"Home\" /\u003e\n\u003cmeta property=\"og:url\" content=\"https://example.com\" /\u003e\n\u003cmeta property=\"og:locale\" content=\"en\" /\u003e\n\u003cmeta property=\"og:site_name\" content=\"My App\" /\u003e\n\u003cmeta property=\"og:type\" content=\"website\" /\u003e\n\u003c!-- Twitter (X) --\u003e\n\u003cmeta name=\"twitter:card\" content=\"summary\" /\u003e\n\u003cmeta name=\"twitter:title\" content=\"Home\" /\u003e\n\u003c!-- JSON-LD --\u003e\n\u003cscript type=\"application/ld+json\"\u003e\n    {\n        \"@context\": \"https://schema.org\",\n        \"@type\": \"WebPage\",\n        \"name\": \"Home\",\n        \"url\": \"https://example.com\"\n    }\n\u003c/script\u003e\n```\n\n### Setting SEO Tags in Controllers\n\nYou will typically want to define your SEO tags dynamically in your controllers. You can do this using either the `seo()` helper or the `SeoManager` facade:\n\n```php\nnamespace App\\Http\\Controllers;\n\nuse \\Elegantly\\Seo\\Facades\\SeoManager;\nuse Elegantly\\Seo\\Standard\\Alternate;\n\nclass HomeController extends Controller\n{\n    public function __invoke()\n    {\n        // Using the helper\n        seo()\n            -\u003esetTitle(\"Homepage\")\n            -\u003esetImage(asset('images/opengraph.jpg'))\n            -\u003esetDescription(\"The homepage description\")\n            -\u003ewhen(!App::isProduction(), fn($seo) =\u003e $seo-\u003enoIndex())\n            -\u003esetLocale(\"fr\")\n            -\u003esetAlternates([\n                new Alternate(\n                    hreflang: \"en\",\n                    href: route('home', ['locale' =\u003e \"en\"]),\n                ),\n                new Alternate(\n                    hreflang: \"fr\",\n                    href: route('home', ['locale' =\u003e \"fr\"]),\n                ),\n            ])\n            -\u003esetOpengraph(function(OpenGraph $opengraph){\n                $opengraph-\u003etitle = \"Custom opengraph title\";\n                return $opengraph;\n            });\n\n        // Using the facade\n        SeoManager::current()\n            -\u003esetTitle(\"Homepage\")\n            -\u003esetDescription(\"The homepage description\");\n            // ...\n\n        return view('home');\n    }\n}\n```\n\nThen, in your Blade view, just render the tags like this:\n\n```html\n\u003chead\u003e\n    {!! seo() !!}\n\u003c/head\u003e\n```\n\n### Advanced Usage\n\nFor more complex SEO needs, you can instantiate and configure the `SeoManager` class directly. This gives you full control over every tag, including Open Graph, Twitter, JSON-LD, and custom schema tags.\n\n```php\nuse Elegantly\\Seo\\SeoManager;\nuse Elegantly\\Seo\\Standard\\Standard;\nuse Elegantly\\Seo\\OpenGraph\\OpenGraph;\nuse Elegantly\\Seo\\Twitter\\Cards\\Card;\nuse Elegantly\\Seo\\Schemas\\Schema;\nuse Elegantly\\Seo\\SeoTags;\n\n$seo = new SeoManager(\n    standard: new Standard(/* ... */),\n    opengraph: new OpenGraph(/* ... */),\n    twitter: new Card(/* ... */),\n    webpage: new WebPage(/* ... */),\n    schemas: [/* ... */],\n    customTags: new SeoTags(/* ... */)\n);\n```\n\nThen, in your Blade view:\n\n```html\n\u003chead\u003e\n    {!! $seo !!}\n\u003c/head\u003e\n```\n\n## Testing\n\nTo run the tests:\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for details on recent updates.\n\n## Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md) for guidelines on contributing to this project.\n\n## Security\n\nPlease refer to our [security policy](../../security/policy) for reporting vulnerabilities.\n\n## Credits\n\n-   [Quentin Gabriele](https://github.com/QuentinGab)\n-   [All Contributors](../../contributors)\n\n## License\n\nThis package is licensed under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felegantengineeringtech%2Flaravel-seo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felegantengineeringtech%2Flaravel-seo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felegantengineeringtech%2Flaravel-seo/lists"}