Changed
- This file follows Keep a Changelog 1.1.0: every release from 1.0.0 up says what it added, changed or fixed for someone using the package, where it listed pull request titles with bare URLs and left 1.1.0 and 1.0.0 out altogether (#15).
- An entry lands under
[Unreleased]in the pull request that makes the change, and the release moves it under its version.stefanzweifel/changelog-updater-actionused to write the file from each release body after the fact, so nothing described the change itself (#15).
Removed
CHANGELOG.mdfrom the Composer dist archive (export-ignore), as with the README and the test suite (#15).
Changed
- The documentation pages are MDX and carry the docs hub’s Starlight components — the install and usage variants in
<Tabs>, the caveats as<Aside>, the setup as<Steps>and the published paths as<FileTree>— where they were flat Markdown (#13, #14).
Fixed
- The Open Graph example on the Blade page echoes
canonical()->generate(), where it echoed a barecanonical(): without arguments the helper hands back the generator, so the copied snippet threw instead of printing a URL (#13). - The configuration and API pages put the domain validation where it happens — the first time the generator is resolved from the container, a bare
canonical()included — instead of promising it on the first generated URL (#13).
Added
- Documentation at docs.fkrzski.dev/laravel-canonical: a guide, the configuration reference, the Blade entry points, an API reference and a page on testing, validated in CI against the shared
@fkrzski/docs-schemacontract (#12).
Fixed
- Laravel’s package discovery registers
CanonicalServiceProviderand theCanonicalfacade alias.extra.laravelincomposer.jsonspelled both class names with doubled backslashes, which resolve to no class at all, so an application that did not register them by hand got neither (#12).
1.4.0
Changed
- Requires
illuminate/support^12.0 | ^13.0, so the package installs on Laravel 12 and 13 and no longer on Laravel 11 (#9).
1.3.0
Changed
- Requires PHP
^8.4 | ^8.5, where 1.2.0 still installed on 8.3 (#6).
1.2.0
Added
<x-canonical />, a Blade component rendering<link rel="canonical" href="..." />for the current request, or for the path given as itspathprop. Its view publishes withphp artisan vendor:publish --tag="canonical-views"(#4).@canonical, a Blade directive printing the same tag, with the path as an optional expression (#4).canonical(), a helper autoloaded with the package: given a path it returns the canonical URL as a string, and without arguments theCanonicalUrlGeneratorInterfaceitself, to chaingenerate()on (#4).
1.1.0
Added
canonical.trim_trailing_slash(CANONICAL_TRIM_TRAILING_SLASH),trueby default and trimming as 1.0.0 did. Set tofalse, a path that came in with a trailing slash keeps it, the bare domain included (#2).
Changed
CanonicalConfigInterfacedeclaresshouldTrimTrailingSlash(), andCanonicalUrlBuildertakes aCanonicalConfigInterface, so an own implementation of the contract, or a builder constructed by hand, has to supply them (#2).
1.0.0
Added
Canonicalfacade overCanonicalUrlGeneratorInterface::generate(): without an argument it returns the canonical URL of the current request, its query string included, and with a path the canonical URL of that path. Trailing slashes are removed.canonical.domain(CANONICAL_DOMAIN, falling back toAPP_URLand then tohttp://localhost), the base every generated URL is built on, published withphp artisan vendor:publish --tag="canonical-config".CanonicalConfigurationException, thrown when the configured domain is empty, is not a valid URL, uses a scheme other thanhttporhttps, or carries no host.CanonicalServiceProvider, a deferred provider bindingBaseUrlValidatorInterface,CanonicalConfigInterface,CanonicalUrlBuilderInterfaceandCanonicalUrlGeneratorInterfaceas singletons, each of them replaceable.