New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

salamwaddah/laravel-canonical

:package_description
3,981 3
Install
composer require salamwaddah/laravel-canonical
Latest Version:v1.3.0
PHP:>=8.0
Laravel:9 – 13
Older releases:8
License:MIT
Last Updated:May 15, 2026
Links: GitHub  ·  Packagist
Maintainer: salamwaddah

Laravel canonical

Laravel Canonical is a simple package designed to help you manage canonical URLs in your Laravel applications. This package provides a convenient way to generate canonical URLs based on the current request, allowing you to avoid duplicate content issues and improve SEO.

Installation

composer require salamwaddah/laravel-canonical

Usage

Add to your layout or any blade file where canonical is needed

<link rel="canonical" href="{{ canonical() }}"/>

Configuration

The package comes with a default configuration file that allows you to specify which query parameters should be included in the canonical URL.

The following default configuration will filter out any query parameters in the page URL and only allow the page=1, page=2, page=...

// canonical.php
'allowed_params' => [
    'page',
],

You can customize this configuration to meet your specific requirements. To publish the configuration file, run the following command:

php artisan vendor:publish --tag=laravel-canonical-config

Testing

composer test

Related Packages

exa2040/laravel-seo

A SEO extension for your laravel project.

12 0
seo
fkrzski/laravel-canonical

Laravel package for managing canonical URLs and preventing duplicate content

1,466 2
aerni/advanced-seo

Comprehensive SEO addon for Statamic with flexibility in mind

22,268 18
jwohlfert23/laravel-seo

SEO tools to insert meta data in laravel projects

6,762 3
witify/laravel-seo-attributes

Quickly add SEO attribute to your views in Laravel

1,844 0

Version History

Version Released PHP Laravel License
v1.3.0 >=8.0 ^9.0|^10.0|^11.0|^12.0|^13.0 MIT
v1.2.1 >=7.3 ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0 MIT
v1.2.0 >=7.3 ^8.0|^9.0|^10.0|^11.0|^12.0 MIT
v1.1.0 >=7.3 ^8.0|^9.0|^10.0|^11.0 MIT
1.0.1 >=7.3 ^8.0|^9.0|^10.0|^11.0 MIT