Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/294.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
php laravel刀片文件身份验证::检查不起作用_Php_Laravel - Fatal编程技术网

php laravel刀片文件身份验证::检查不起作用

php laravel刀片文件身份验证::检查不起作用,php,laravel,Php,Laravel,我正在使用laravel中的Auth::check函数。在所有控制器中,其工作正常,但在刀片文件中,它将不工作 我犯了这个错误 哎呀,好像出了什么事 中的1/1 FatalErrorException /var/www/html/laravel master/storage/framework/views/e016f9336e75e5cb0b189c91cd736729b7184a61.php 第5行:调用undefined方法illumb\Auth\AuthManager::check() 在

我正在使用laravel中的
Auth::check
函数。在所有控制器中,其工作正常,但在刀片文件中,它将不工作

我犯了这个错误

哎呀,好像出了什么事

中的1/1 FatalErrorException /var/www/html/laravel master/storage/framework/views/e016f9336e75e5cb0b189c91cd736729b7184a61.php 第5行:调用undefined方法illumb\Auth\AuthManager::check() 在e016f9336e75e5cb0b189c91cd736729b7184a61.php第5行中

我的刀片文件身份验证检查代码为

@if(Auth::check())
    <div class="dispayingTextDiv"></div>
@endif
@if(Auth::check())
@恩迪夫
有什么问题吗?

如果
Auth::check()
不起作用,请改用
illumb\Support\Facades\Auth::check()

@if(Illuminate\Support\Facades\Auth::check())
    <div class="dispayingTextDiv"></div>
@endif
@if(照亮\Support\Facades\Auth::check())
@恩迪夫

尝试使用:
auth()->check()
\auth::check()
,或删除
/var/www/html/laravel master/storage/framework/views/
auth:-

您可以进行如下检查(5.5+)


您可以使用刀片指令执行以下操作:


对于未经验证的,您可以使用

@guest
//显示未经验证的案例
@终客
试试这个方法

@guest
    // Show content if  unauthenticated
@endguest

@auth
    // The data only available for auth user
@endauth

语法错误。Auth::check()之后没有“')。抱歉,我编辑了,请再次查看我的代码。我的错误是真的这里有一些指导方针。提供的答案可能是正确的,但可以从解释中获益。但这对于普通laravel用户来说是可以理解的
@auth
// The user is authenticated...
@endauth
@guest
    // Show content if  unauthenticated
@endguest

@auth
    // The data only available for auth user
@endauth