我想在中间件中调用一个控制器函数,代码该怎么写呢
我想在中间件中调用一个控制器函数,代码该怎么写呢。
中间件------------------------
<?php
namespace App\Http\Middleware;
use Closure;
class MyMiddleware
{
public function handle($request, Closure $next)
{
}
}
Controller
<?php namespace App\Http\Controllers\Web;
use Illuminate\Http\Request;
class MyController {
public function my() {
}
}
---------------------
我想在中间件中调用my()方法,该怎么写代码
中间件------------------------
<?php
namespace App\Http\Middleware;
use Closure;
class MyMiddleware
{
public function handle($request, Closure $next)
{
}
}
Controller
<?php namespace App\Http\Controllers\Web;
use Illuminate\Http\Request;
class MyController {
public function my() {
}
}
---------------------
我想在中间件中调用my()方法,该怎么写代码
0 个回复