我正在创建一个多重身份验证系统,我试图显示一个名为“场地”的登录场地模型中包含的数据,但我似乎无法访问它,它一直在标题中抛出错误?网上没有太多有用的信息,我想知道是否有人可以伸出援手?
场地.blade.php:
@extends('layouts.auth')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Dashboard</div>
{{ dd(Auth::venue()) }}
<div class="card-body">
</div>
</div>
</div>
</div>
</div>
@endsection
登录控制器:
public function venueLogin(Request $request)
{
$this->validate($request, [
'email' => 'required|email',
'password' => 'required|min:6'
]);
if (Auth::guard('venue')->attempt(['email' => $request->email, 'password' => $request->password], $request->get('remember'))) {
return redirect()->intended('/venue');
}
return back()->withInput($request->only('email', 'remember'));
}
守卫:
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
'hash' => false,
],
'customer' => [
'driver' => 'session',
'provider' => 'customers',
],
'customer-api' => [
'driver' => 'token',
'provider' => 'customers',
'hash' => false,
],
'venue' => [
'driver' => 'session',
'provider' => 'venues',
],
'venue-api' => [
'driver' => 'token',
'provider' => 'venues',
'hash' => false,
],
],
如有任何帮助,我将不胜感激!Laravel 真的有问题:(
侃侃无极