资源/视图/布局/navigation.blade.php: 8需要
在我的主页 Laravel
<!-- resources/views/page.blade.php -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Front Page</title>
</head>
<body>
<!-- Include the navigation menu -->
@include('layouts.navigation')
<!-- Your front page content goes here -->
<h1>Welcome to the front page</h1>
<p>This is the content of your front page.</p>
</body>
</html>
和我的布局导航
我在这一行有错误:@if (auth()->user()->manages())
在 null 上调用成员函数 Manages()
扩展供应商框架资源/视图/布局/navigation.blade.php: 8需要9个供应商框架资源/视图/welcome.blade.php: 10需要56个供应商框架public/index.php: 51 require_once 1个供应商框架< /p>
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
这意味着您没有经过身份验证的用户,因此首先检查
auth()->user()是否存在,例如:@if (!is_null(auth()->user())) //if auth()->user() is not null, you can call the manages() function on it @if(auth()->user()->manages()) //content you want @endif @endif