This package allows you to add redirects via Filament manually or with an import via Excel or csv
You can install the package via composer:
composer require codedor/filament-redirects
You can publish and run the migrations with:
php artisan vendor:publish --tag="filament-redirects-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="filament-redirects-config"
This is the contents of the published config file:
return [
'route-wildcard' => '*',
'default-status' => 302,
];
To make the redirects work, you have to register the Redirects middleware
// app/Http/Kernel.php
protected $middleware = [
// ...
\Codedor\FilamentRedirects\Http\Middleware\Redirects::class,
];
And also register the plugin in your Panel provider:
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
\Codedor\FilamentRedirects\Filament\RedirectsPlugin::make(),
]);
}
This package has a couple of config values:
<?php
return [
'route-wildcard' => '*',
'default-status' => 302,
];
This determines what the wildcard is in the CMS. By default this is *
, but can be changed for whatever reason if necessary.
The default HTTP status that the redirects uses, if none is given.