【发布时间】:2015-06-04 10:57:31
【问题描述】:
我已经开始学习 Laravel 5。关注this tutorial。我收到此错误。 (Class 'App\Http\Controllers\Url' not found)。
我在这里附上了我的代码图片。
Whoops, looks like something went wrong.
1/1
FatalErrorException in UrlController.php line 22:
Class 'App\Http\Controllers\Url' not found
in UrlController.php line 22
at FatalErrorException->__construct() in compiled.php line 1838
at HandleExceptions->fatalExceptionFromError() in compiled.php line 1833
at HandleExceptions->handleShutdown() in compiled.php line 0
at UrlController->store() in compiled.php line 8504
at call_user_func_array:{C:\wamp\www\readit-later\vendor\compiled.php:8504}() in compiled.php line 8504
at Controller->callAction() in compiled.php line 8572
at ControllerDispatcher->call() in compiled.php line 8551
at ControllerDispatcher->Illuminate\Routing\{closure}() in compiled.php line 9190
帮帮我。
【问题讨论】:
-
这是一个命名空间问题。将
use Url放在页面顶部或写$url = new \Url()。发生这种情况是因为您正在学习 laravel 4 教程,并且您使用的是 laravel 5,您需要在其中指定要使用的内容。 -
你忘记创建 eloquent 模型了。
标签: php laravel-5 laravel-routing