PHP code example of bernhardh / nova-redirect-tester

1. Go to this page and download the library: Download bernhardh/nova-redirect-tester 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/ */

    

bernhardh / nova-redirect-tester example snippets


// file app/Providers/NovaServiceProvider.php

public function tools()
{
    return [
        // ...
        \Bernhardh\NovaRedirectTester\NovaRedirectTester::make()
    ];
}


// File app/Nova/RedirectTestGroup

namespace App\Nova;

class RedirectTestGroup extends \Bernhardh\NovaRedirectTester\Nova\RedirectTestGroup {}


// File app/Nova/RedirectTest

namespace App\Nova;

class RedirectTest extends \Bernhardh\NovaRedirectTester\Nova\RedirectTest {}

// routes/web.php
Route::get('cms/categories/articles/{article}.htm', function($article){
    return redirect('articles/' . $article);
});
Route::get('static-site/{article}.html', function($article){
    return redirect('articles/' . $article);
});
Route::get('articles/{article}', function($article){
    return '<h1>' . $article . '</h1>';
});

php artisan migrate