Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel 未找到流明类路由_Laravel_Lumen_Laravel Passport - Fatal编程技术网

Laravel 未找到流明类路由

Laravel 未找到流明类路由,laravel,lumen,laravel-passport,Laravel,Lumen,Laravel Passport,我正在尝试实现中所述的代码 这给了我错误找不到类路由。我的问题是如何在lumen中使用Route:dispatch()? 谢谢我找到了这个问题的解决方案。我们可以使用以下代码 $proxy = Request::create( '/oauth/token', 'post', [ 'grant_type'=>$grant_type, 'client_id'=>$client_id,

我正在尝试实现中所述的代码

这给了我错误找不到类路由。我的问题是如何在lumen中使用Route:dispatch()?
谢谢

我找到了这个问题的解决方案。我们可以使用以下代码

$proxy = Request::create(
        '/oauth/token',
        'post',
        [
            'grant_type'=>$grant_type,
            'client_id'=>$client_id,
            'client_secret'=>$client_secret,
            'username'=>$username,
            'password'=>$password
        ]

    );



    return App::dispatch($proxy);
流明5.4

global $app;    

$proxy = Request::create(
    '/oauth/token',
    'post',
    [
        'grant_type'=>$grant_type,
        'client_id'=>$client_id,
        'client_secret'=>$client_secret,
        'username'=>$username,
        'password'=>$password
    ]

);

return $app->dispatch($proxy);

Lumen使用了一个完全不同的路由器,这一个:所以通过使用fastRoute我可以解决上面的问题,对吗?如何在上面添加新的头?有什么想法吗
global $app;    

$proxy = Request::create(
    '/oauth/token',
    'post',
    [
        'grant_type'=>$grant_type,
        'client_id'=>$client_id,
        'client_secret'=>$client_secret,
        'username'=>$username,
        'password'=>$password
    ]

);

return $app->dispatch($proxy);