- Follow the official website guide
- To modify your own Composer.json configuration
By official website Guide
Address: Http://laravel-china.org/docs/5.0/upgrade
All actions have been completed by the wizard
Modifying the Composer.json configuration
"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" },
After modifying this write configuration, execute the composer update, it will not move, as follows:
Change to a domestic mirror
"minimum-stability""stable", "repositories": [ {"type""composer""url""http://pkg.phpcomposer.com/repo/packagist/"}, {"packagist"false} ]
After Composer.json finally add this, composer update after the error, as follows:
Also do not know whether this domestic image of the package complete incomplete caused?
A little bit of tweaking.
Modified by:
"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 again, the results again error:
What should I do?
Really do not know what to do, and finally decided to re-download the Laravel installation package, and then back again.
Try downloading the Laravel installation package again
Perform:
globalrequire"laravel/installer=~1.1"
And then it was a long wait ...
Solutions
- Barryvdh/laravel-ide-helper version issue, replace the following:
"barryvdh/laravel-ide-helper""2.*"
- There is a version number problem way/generators, these version problems are 5.0 is not supported, so change the version number:
"way/generators""~3.0"
- Remove the Sentry plugin (should be 5.0 does not support the plug-in 2. version, then 3. Version is also charged), so choose not to use:
"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"] },
It is also necessary to remove the corresponding reference in the app.php.
‘Illuminate\Workbench\WorkbenchServiceProvider‘, ‘Way\Generators\GeneratorsServiceProvider‘, ‘Cartalyst\Sentry\SentryServiceProvider‘,
After removing these several, finally composer update succeeded.
- Although the operation was successful, there was a problem with the form request:
Workaround:
Add a hidden commit value to the form
<input type="hidden" name="_token" value="{{ csrf_token() }}">
Of course, if you do not want to use this: CSRF protection, that is, do not need every form in the form to add this sentence, is also possible.
Please remove this line from the middleware array in App\http\kernel
‘App\Http\Middleware\VerifyCsrfToken‘,
If you want to use it somewhere else, join this line to $routeMiddleware:
‘csrf‘‘App\Http\Middleware\VerifyCsrfToken‘,
Finally succeeded.
So far, 4.2 upgrade 5.0 is finally over.
Laravel 4.2 Upgrade 5.0 encounter the wonderful problem