<?php

namespace Brayniverse\LaravelRedirectHelper;

use Illuminate\Support\Facades\Route;

class ServiceProvider extends \Illuminate\Support\ServiceProvider
{
    public function register()
    {
        Route::macro('redirect', function ($url, $destination, $status = 301) {
            Route::any($url, '\Brayniverse\LaravelRedirectHelper\RedirectController@handle')
                ->defaults('redirection', compact('destination', 'status'));
        });
    }
}

<?php

namespace Brayniverse\LaravelRedirectHelper;

use Illuminate\Support\Facades\Route;

class ServiceProvider extends \Illuminate\Support\ServiceProvider
{
    public function register()
    {
        Route::macro('redirect', function ($url, $destination, $status = 301) {
            return Route::any($url, '\Brayniverse\LaravelRedirectHelper\RedirectController@handle')
                ->defaults('redirection', compact('destination', 'status'));
        });
    }
}

Allow fluid route declaration methods to work
Allow fluid route declaration methods to work

Methods like `Route::redirect('foo', 'bar')->middleware('baz');` do not work unless you return the route instance that is created by this macro.