【问题标题】:builtin 'Laravel Class not found' in fresh installation全新安装中的内置“未找到 Laravel 类”
【发布时间】:2015-02-01 13:21:39
【问题描述】:

我正在尝试学习 laravel,因此通过 composer 下载了它。在 YouTube 上的某个地方,一个人从“route.php”文件开始,所以我只是跟着他,但相反,我在浏览器上遇到了一个错误,即“致命错误:在 C:\wamp\ 中找不到类 'Route' www\php\lara\app\routes.php 第 14 行”。此错误显示 'Call Stack' 沿 'Time'、'Memory'、'Function'、'位置”字段。当我切换到其他相邻文件即 Filters.php 时,它显示与类“app”而不是“路由”相同的错误。 .之后,如果我切换到“public”文件夹和“index.php”,它会显示 laravel 徽标。我正在使用带有实时预览的括号。现在我搜索了它,但没有太多回复查询(如果有的话)。

如果您需要此文件的更多详细信息:

<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

Route::get('/', function()
{
    return View::make('hello');
});

注意:如果我不使用 Brackets 的实时预览,而只是移动到 'localhost/php/lara/app/' 它不会显示任何错误,而是显示其他页面的空白页面文件夹,即“命令”、“配置”、“控制器”等。 我只是不知道该怎么做,因为这是我第一次尝试任何 MVC FRAMEWORK FOR PHP。 谢谢!

【问题讨论】:

    标签: php laravel-4 laravel-routing adobe-brackets


    【解决方案1】:

    似乎缺少自动加载文件。您是否使用 composer 安装了 Laravel?如果你这样做了,请尝试通过运行以下命令来重新生成自动加载文件:

    composer dump-autoload
    

    如果您没有使用 composer 安装它,请关注 Laravel 文档http://laravel.com/docs/4.2/quick#installation

    【讨论】:

    • @Giedrius 我都做了,即作曲家转储自动加载,更新。但什么都没有。
    猜你喜欢
    • 2023-03-23
    • 1970-01-01
    • 2017-11-30
    • 2016-03-31
    • 2020-06-20
    • 2018-12-09
    • 1970-01-01
    • 2016-09-02
    • 1970-01-01
    相关资源
    最近更新 更多