I have this code on my routes.php
file that do a redirect. Though the problem is that whenever I ran php artisan route:cache
command, it gives me an error of Unable to prepare route [article/{params}] for serialization. Uses Closure.
I know this has something to do with routes not allowing it to be cached if it have a closure. But how could I make a workaround for this redirect?
Route::get('article/{params}', function($params) {
return Redirect::to($params, 301);
});