Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.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 5.5-在供应商软件包中使用身份验证_Laravel_Authentication - Fatal编程技术网

Laravel 5.5-在供应商软件包中使用身份验证

Laravel 5.5-在供应商软件包中使用身份验证,laravel,authentication,Laravel,Authentication,有没有办法在供应商包中使用Auth::check()或调用Auth::user() 我尝试使用: -中间件web, -使用Auth 两者都不起作用。 谢谢。请查找以下代码: Retrieving The Authenticated User You may access the authenticated user via the Auth facade: use Illuminate\Support\Facades\Auth; // Get the currently authentica

有没有办法在供应商包中使用Auth::check()或调用Auth::user()

我尝试使用: -中间件web, -使用Auth

两者都不起作用。
谢谢。

请查找以下代码:

Retrieving The Authenticated User
You may access the authenticated user via the Auth facade:

use Illuminate\Support\Facades\Auth;

// Get the currently authenticated user...
$user = Auth::user();

// Get the currently authenticated user's ID...
$id = Auth::id();

请查找以下代码:

Retrieving The Authenticated User
You may access the authenticated user via the Auth facade:

use Illuminate\Support\Facades\Auth;

// Get the currently authenticated user...
$user = Auth::user();

// Get the currently authenticated user's ID...
$id = Auth::id();

当然。您的代码是正确的,并且工作完美。但一定要特别注意“使用”块

use Illuminate\Support\Facades\Auth;

当然。您的代码是正确的,并且工作完美。但一定要特别注意“使用”块

use Illuminate\Support\Facades\Auth;

谢谢,但它不起作用:-(因此,我在App\Http\controller中用自定义控制器覆盖包控制器。

谢谢,但它不起作用:-(因此,我在App\Http\controller中用自定义控制器覆盖包控制器