PHPackages                             crumby/canonical-hreflang - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. crumby/canonical-hreflang

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

crumby/canonical-hreflang
=========================

Automatic canonical and hreflang output for Laravel 5.4

1.0.0(8y ago)038MIT LicensePHPPHP &gt;=5.6.0

Since Aug 21Pushed 8y agoCompare

[ Source](https://github.com/avassilenko/canonical-hreflang)[ Packagist](https://packagist.org/packages/crumby/canonical-hreflang)[ Docs](https://github.com/avassilenko/canonical-hreflang)[ RSS](/packages/crumby-canonical-hreflang/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Installation:
-------------

[](#installation)

```
> composer require crumby/canonical-hreflang
> php artisan vendor:publish --provider="Crumby\CanonicalHreflang\CanonicalHreflangServiceProvider" --tag=config

```

Register service and facade:
----------------------------

[](#register-service-and-facade)

File: config/app.php

```
'providers' => [
    ......................
    'Crumby\CanonicalHreflang\CanonicalHreflangServiceProvider',
    ........................
 ];

 'aliases' => [
    ......................
    'Canonicalhreflang' => 'Crumby\CanonicalHreflang\Facades\CanonicalHreflang',
    ......................
 ];

```

Register global middlewear:
---------------------------

[](#register-global-middlewear)

file app/Http/Kernel.php

```
protected $middleware = [
        .............................
        \Crumby\CanonicalHreflang\Middleware\CanonicalHreflangMiddleware::class
    ];

```

Configuration:
--------------

[](#configuration)

Besides automatically set canonical url links to head, it also sets Hreflang, if unabled. config/canonical-hreflang.php

```
    'multilangular' => true

```

Example:
--------

[](#example)

- add middleware to constructor of your controller

    ```
        class StaticPagesController extends Controller {
            public function __construct()
            {
                ...........................
                $this->middleware('CanonicalHreflang');
                ...........................
            }
        }

    ```
- place this variable to your Blade template head section

    ```
    {!! $CanonicalHreflang !!}

    ```

Documentation:
--------------

[](#documentation)

[API documentation](https://www.crumby-pack.com/packages/laravel-54-hreflang-canonical-tags)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3189d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/77a60c22937e5d0474647d9d79973073ba5d349f15d2955a13b91b42d1048c3d?d=identicon)[crumby](/maintainers/crumby)

---

Tags

canonicalhreflang

### Embed Badge

![Health badge](/badges/crumby-canonical-hreflang/health.svg)

```
[![Health](https://phpackages.com/badges/crumby-canonical-hreflang/health.svg)](https://phpackages.com/packages/crumby-canonical-hreflang)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
