PHP code example of black-bits / laravel-seo-rewrite

1. Go to this page and download the library: Download black-bits/laravel-seo-rewrite 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/ */

    

black-bits / laravel-seo-rewrite example snippets


SeoRewrite::create([
    'source'      => '/old-route',
    'destination' => '/new-route',
    'type'        => 301
]);

SeoRewrite::create([
    'source'      => '/old-route',
    'destination' => 'https://your-new.domain/old-route',
    'type'        => 308
]);
bash
php artisan migrate