我有以下课程
use Illuminate\Support\Facades\View;
class WebUser
{
public function __construct()
{
$status = (object) [
'isLogin' => (Session::get('token')? true : false),
'isSubscribed' => $this->isSubscribed(),
'isPlatinum' => $this->isPlatinum(),
'isExpired' => $this->isExpired()
];
View::share('thisUser',$status);
}
此类将在用户成功登录后运行。
我尝试在视图文件{{$ thisUser}}中查看共享变量,给出错误
Undefined variable: thisUser (View: