1. Go to this page and download the library: Download marshmallow/redirectable 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/ */
marshmallow / redirectable example snippets
use Marshmallow\Redirectable\Facades\Redirector;
// routes/web.php — register this after your own routes
Redirector::routes();
use Marshmallow\Redirectable\Nova\Redirect;
protected function resources(): void
{
Nova::resources([
Redirect::class,
]);
}
use Illuminate\Database\Eloquent\Model;
use Marshmallow\Redirectable\Traits\Redirectable;
class Page extends Model
{
use Redirectable;
}
use Marshmallow\Redirectable\Facades\Redirector;
Redirector::add($page, '/old-url', '/new-url');