Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/260.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
Php Laravel 4.x文档是否在扩展身份验证时出错?_Php_Authentication_Laravel_Laravel 4 - Fatal编程技术网

Php Laravel 4.x文档是否在扩展身份验证时出错?

Php Laravel 4.x文档是否在扩展身份验证时出错?,php,authentication,laravel,laravel-4,Php,Authentication,Laravel,Laravel 4,Laravel 4.x文档声明Auth::extend()回调应为“”: 但是,许多关于扩展Laravel 4身份验证的声明指出,Auth::extend()应返回一个illumb\Auth\Guard实例,该实例将UserProviderInterface实例作为参数: Auth::extend('example', function($app) { $provider = new \Example\Auth\ExampleUserProvider(); return ne

Laravel 4.x文档声明Auth::extend()回调应为“”:

但是,许多关于扩展Laravel 4身份验证的声明指出,Auth::extend()应返回一个illumb\Auth\Guard实例,该实例将UserProviderInterface实例作为参数:

Auth::extend('example', function($app) {
    $provider =  new \Example\Auth\ExampleUserProvider();

    return new \Illuminate\Auth\Guard($provider, $app['session']);
});
我在Laravel 4.0应用程序中使用了后一种方法,并且它正在工作。我没法让孩子们去上班。我查看了Laravel升级指南,在这方面没有提到任何API更改


Laravel 4.x文档有错误吗?

这在Laravel文档中已经被清除:“传递给Auth::extend方法的回调应该返回一个light\Contracts\Auth\Guard的实现。”

有关详细信息,请参阅:

Auth::extend('example', function($app) {
    $provider =  new \Example\Auth\ExampleUserProvider();

    return new \Illuminate\Auth\Guard($provider, $app['session']);
});