地址:http://laravel-china.org/docs/5.0/upgrade
所有操作都已经按向导一步一步完成
"require": {
"laravel/framework": "4.2.*",
"cartalyst/sentry": "2.1.4",
"barryvdh/laravel-ide-helper": "1.*"
},
"require-dev": {
"way/generators": "~2.0",
"fzaninotto/faker": "1.4.0",
"edvinaskrucas/notification": "3.0.1"
},
修改了这写配置后,执行composer update,就一直不动,截图如下:
"minimum-stability": "stable",
"repositories": [
{"type": "composer", "url": "http://pkg.phpcomposer.com/repo/packagist/"},
{"packagist": false}
]
在composer.json最后加上这个后,composer update 后又报错了,截图如下:
也不知道是不是这个国内镜像的包完整不完整导致的?
修改了:
"require": {
"laravel/framework": "5.0.*",
"cartalyst/sentry": "2.1.4",
"barryvdh/laravel-ide-helper": "1.*"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"way/generators": "~2.0",
"fzaninotto/faker": "1.4.0",
"edvinaskrucas/notification": "3.0.1"
},
再次update,结果又报错了:
该怎么办?
真的不知道该如何是好了,最后决定重新下载laravel的安装包,然后再重新来一遍了。
执行:
composer global require "laravel/installer=~1.1"
然后就是漫长的等待了…
"barryvdh/laravel-ide-helper": "2.*"
"way/generators": "~3.0"
"require-dev" : {
"phpunit/phpunit" : "~4.0",
"phpspec/phpspec" : "~2.1",
"fzaninotto/faker": "1.4.0",
"edvinaskrucas/notification": "4.*",
"way/generators": "~3.0"
},
"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 -r \"copy(‘.env.example‘, ‘.env‘);\"", "php artisan key:generate" ]
},
还需要在app.php里去掉相应的引用。
‘Illuminate\Workbench\WorkbenchServiceProvider‘,
‘Way\Generators\GeneratorsServiceProvider‘,
‘Cartalyst\Sentry\SentryServiceProvider‘,
去掉这几个后,终于composer update成功了。
<input type="hidden" name="_token" value="{{ csrf_token() }}">
当然如果不想用这个:CSRF 保护,也就是不需要每个form表单里都加这句,也是可以的。
请移除 App\Http\Kernel 中 middleware 数组内的这一行
‘App\Http\Middleware\VerifyCsrfToken‘,
如果您想在其他地方使用它,加入这一行到 $routeMiddleware:
‘csrf‘ => ‘App\Http\Middleware\VerifyCsrfToken‘,
到此为止,4.2升级5.0终于告一段落。
原文地址:http://blog.csdn.net/a437629292/article/details/44196657