找不到类别"Illuminate \ Support \ facades \ Schema" [英] Class 'Illuminate\Support\facades\Schema' not found

查看:845
本文介绍了找不到类别"Illuminate \ Support \ facades \ Schema"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Laravel5.4.当我使用社交名流包登录Facebook时,我需要添加

I am working with Laravel5.4. When I use socialite package to login with Facebook, I need to add this line of

Schema::defaultStringLength(191);

启动AppServiceProvider类的功能,以便为新用户创建默认密码.

to boot function of AppServiceProvider class in order to create default password for new user.

此外,我还必须在AppServiceProvider类顶部添加using语句

Beside that I have to add using statement at top of AppServiceProvider class like this

use Illuminate\Support\facades\Schema;

一切都可以在我的本地主机上正常运行,但是当我将所有代码上传到共享主机时,都会出现此错误

Everything is working well on my localhost but when I upload all code to my share hosting, I get this error

找不到"Illuminate \ Support \ facades \ Schema"类.

Class 'Illuminate\Support\facades\Schema' not found.

有人可以帮我吗?非常感谢您的帮助!

Can anyone help me on this. I am highly appreciated your help!

推荐答案

OMG我遵循下面带标记的问题的答案,并将using语句替换为

OMG I follow the marked answer of question below and replace the using statement with

use Schema;

,错误消失了.但是我仍然不知道为什么它在本地运行良好,只会在服务器上导致错误.

and the error gone. But I still don't know why it works well on local and only cause error on server.

在发光"类中找不到方法创建" \ Support \ Facades \ Schema

这篇关于找不到类别"Illuminate \ Support \ facades \ Schema"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆