PHP code example of yotech-ai / twill-cms-redirects

1. Go to this page and download the library: Download yotech-ai/twill-cms-redirects 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/ */

    

yotech-ai / twill-cms-redirects example snippets


'providers' => [
    // ...
    TwillRedirects\TwillRedirectsServiceProvider::class,
],

use TwillRedirects\Http\Middleware\RedirectMiddleware;
use Illuminate\Foundation\Configuration\Middleware;

->withMiddleware(function (Middleware $middleware) {
    $middleware->prepend(RedirectMiddleware::class);
})

use TwillRedirects\PluginPage\TwillPluginServiceProvider;

class TwillSeoServiceProvider extends TwillPluginServiceProvider
{
    protected function twillPlugin(): array
    {
        return [
            'name' => 'SEO',
            'description' => 'Meta tags, sitemaps and structured data.',
            'package' => 'yotech-ai/twill-cms-seo',
            'route' => config('twill.admin_route_name_prefix', 'twill.') . 'seo',
            // Optional: 'url' => '...', 'icon' => '...', 'version' => '...'
        ];
    }
}
bash
php artisan vendor:publish --tag="twill-cms-redirects-migrations"
php artisan migrate