我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Laravel 4:无法访问包类中的Auth实例

I have this class in a workbench package:

class SomeClass{

//Constructor
function __construct(){

    $isAuth = Auth::check();   

    }   

But it gives me following error:

Class 'vendor\pachage\Auth' not found 

Is this a namespace issue? I am using the following namespace:

namespace vendor\pachage;

You need Fully qualified name, add a backslash:

\Auth::check();

It all described as Namepace resolution.

近期文章

  • SQL SELECT ALL BUT {array}
  • 下载文件PHP时出错
  • mbstring.language设置为日语?
  • 如何使用Doctrine 2按特定的一个到多个字段的值排序
  • ElasticSearch从0.90变为1.1
  • 从表单中编写PHP更新代码
  • 如何在Mysql字段中设置默认的当前日期时间
  • 在数组的元素上创建嵌套的foreach
  • 函数内的mysqli_connect包含失败,为什么?
  • COMPOSITE_DISSOLVE无法在PHP中运行
  • 如何将数组的所有值都放在变量中? [重复]
  • 将图像从MSSQL导入PostgreSQL
  • 如何根据给定条件选择最短的GPS坐标?
  • php检查sql数据库,看它是否包含类似于字符串的文本
  • 如何在php中计算时间
  • 通过Twitter Search API阅读推文3周
  • 如果不在连接查询中,则显示列为空
  • Button onClick事件不能运行
  • 来自php的Ajax响应不会将收到的数据显示为可折叠 - jquery mobile?
  • PayPal API处理退货

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华