在Composer更新后,Laravel应用程序无法启动

时间:2014-02-01 14:48:02

标签: php laravel laravel-4

使用composer update更新作曲家后,我的应用程序现在无法启动。

php artisan -V的结果:

Laravel Framework version 4.1.19

错误讯息:

ErrorException

Route [admin.profile.index] not defined. (View: /var/www/laravel/app/views/back_end/menu.blade.php) (View: /var/www/laravel/app/views/back_end/menu.blade.php) (View: /var/www/laravel/app/views/back_end/menu.blade.php)


ErrorException

Route [admin.profile.update] not defined. (View: /var/www/laravel/app/views/back_end/layouts/profile.blade.php)

我的路线:

Route::get('login', array('as'=>'login', function()
{
    return View::make('back_end.login');
}));
Route::group(array('before' => 'auth'), function()
{
  Route::resource('admin/profile' , 'ProfileController' , array('as'=>'profile' , 'before'=>'csrf'));
});

composer.json内容:

{
        "name": "laravel/laravel",
        "description": "The Laravel Framework.",
        "keywords": ["framework", "laravel"],
        "license": "MIT",
        "require": {
                "laravel/framework": "4.1.*",
                "way/generators": "dev-master"
        },
        "autoload": {
                "classmap": [
                        "app/commands",
                        "app/controllers",
                        "app/models",
                        "app/database/migrations",
                        "app/database/seeds",
                        "app/tests/TestCase.php"
                ]
        },
        "scripts": {
                "post-install-cmd": [
                        "php artisan clear-compiled",
                        "php artisan optimize"
                ],
                "post-update-cmd": [
                        "php artisan clear-compiled",
                        "php artisan optimize"
                ],
                "post-create-project-cmd": [
                        "php artisan key:generate"
                ]
        },
        "config": {
                "preferred-install": "dist"
        },
        "minimum-stability": "stable"
}

ProfileController可:

class ProfileController extends \BaseController {

    public $layout = 'back_end.layouts.main';
    public function index()
    {
        $profiles = Auth::user();
        return  View::make('back_end.layouts.profile')->with('profile', $profiles);
    }
}

在更新之前,我的应用程序正常工作,我没有遇到任何问题。

1 个答案:

答案 0 :(得分:0)

当然 - 使用作曲家更新,由于更新的更改,您正在更新软件包并破坏了部分代码。 Composer更新正在读取composer.json文件。您应该运行 composer install ,它正在读取 composer.lock 文件。 Composer.lock 将您的依赖项“锁定”到已知状态,因此您的应用程序无法崩溃。