laravel升级记录,laravel from 5.2 upgrade 5.3
升级之前我们要知道的第一个点,在5.3中被移除的方法如下,详情点击这里
Illuminate\Contracts\Bus\SelfHandling
contract. Can be removed from jobs.Route::controller
have been deprecated. Please use explicit route registration in your routes file. This will likely be extracted into a package.Str::randomBytes
function has been deprecated in favor of the random_bytes native PHP function.Str::equals
function has been deprecated in favor of the hash_equals native PHP function.Illuminate\View\Expression
has been deprecated in favor of Illuminate\Support\HtmlString
.如果是在国内的话,记得更新镜像源,请参考这里
然后修改composer.json中
"laravel/framework": "5.2.*",
改为
"laravel/framework": "5.3.*",
然后执行
composer update --verbose
或者
composer update --verbose --ignore-platform-reqs
如果遇到依赖问题,比如我这里遇到了laravelcollective/html
,
类似requires...satisfiable...
的提示
只需要将这个库暂时移除,然后在执行上面的命令
顺利的话,就安装成功了
然后在安装回刚刚移除的库,比如laravelcollective/html,这个时候可能会遇到,如果使用原来老的版本的话,会提示类似不兼容现在laravel5.3这个版本,需要针对性的安装对应的版本,如果不带版本号的话会安装最新版本,那个时候,依赖的项目会很多,composer会自动升级对应的依赖版本,建议不要这么做
最后安装完,参考[这里],修改对应的代码就可以了。