I have a WordPress installation inside a Laravel project. It is under the /forum folder inside the public folder, so everytime I go to:
http://localhost:8000/forum/
It opens the WordPress page.
I'm having trouble running a middleware instance before this route, though.
I want to:
Route::GET('/forum', function() { })->middleware('wp_login');
Here's my sample middleware:
<?php
namespace App\Http\Middleware;
use Closure;
use Log;
class WpForumLogin
{
public function handle($request, Closure $next)
{
Log::debug("test forum lalalala");
return $next($request);
}
}
The middleware is set up in the Kernel as such:
...
protected $routeMiddleware = [
...
'wp_login' => \App\Http\Middleware\WpForumLogin::class,
];
How do I run this middleware before running the WordPresse's /forum route?
Thank you.