PHP code example of crumby / canonical-hreflang

1. Go to this page and download the library: Download crumby/canonical-hreflang library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

crumby / canonical-hreflang example snippets


> composer san vendor:publish --provider="Crumby\CanonicalHreflang\CanonicalHreflangServiceProvider" --tag=config

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

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