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

时间:2023-01-19 10:36:28

After updating composer using composer update, my application now fails to start.

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

Result of php artisan -V:

php artisan -V的结果:

Laravel Framework version 4.1.19

Error message:

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)

My Route:

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 content:

{
        "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);
    }
}

Before the update, my application worked correctly and I had no problems.

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

1 个解决方案

#1


0  

Of course - with composer update, you were updating packages and broke some of your code due to changes with updates. Composer update is reading from the composer.json file. You should run composer install, which is reading composer.lock file. Composer.lock is "locking" your dependencies to a known state, so you application can't crash.

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

#1


0  

Of course - with composer update, you were updating packages and broke some of your code due to changes with updates. Composer update is reading from the composer.json file. You should run composer install, which is reading composer.lock file. Composer.lock is "locking" your dependencies to a known state, so you application can't crash.

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