Laravel 5.5-在供应商软件包中使用身份验证
有没有办法在供应商包中使用Auth::check()或调用Auth::user() 我尝试使用: -中间件web, -使用Auth 两者都不起作用。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
谢谢。请查找以下代码:
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中用自定义控制器覆盖包控制器