how to upgrade laravel 6 to 7
Asked Answered
S

7

5

i am trying to upgrade laravel 6 to 7, i got an error.

 our requirements could not be resolved to an installable set of
 packages.

   Problem 1
     - Conclusion: remove laravel/framework v6.0.3
     - Conclusion: don't install laravel/framework v6.0.3
     - laravel/ui 2.x-dev requires illuminate/console ^7.0 -> satisfiable by illuminate/console[7.x-dev, v7.0.0],
 laravel/framework[7.x-dev].
     - laravel/ui v2.0.0 requires illuminate/console ^7.0 -> satisfiable by illuminate/console[7.x-dev, v7.0.0],
 laravel/framework[7.x-dev].
     - Can only install one of: laravel/framework[7.x-dev, v6.0.3].
     - don't install illuminate/console 7.x-dev|don't install laravel/framework v6.0.3
     - don't install illuminate/console v7.0.0|don't install laravel/framework v6.0.3
     - Installation request for laravel/framework (locked at v6.0.3, required as ^6.0) -> satisfiable by laravel/framework[v6.0.3].
     - Installation request for laravel/ui ^2.0 -> satisfiable by laravel/ui[2.x-dev, v2.0.0].
Strutting answered 4/3, 2020 at 6:28 Comment(2)
check this laravel.com/docs/7.x/upgradeDoggo
Of course the Upgrade Guide is the de facto place to learn about what's changed. But I'll humbly suggest Shift as an answer for how to upgrade Laravel.Blasto
P
13

Just follow the documentation, you must have installed php7.2.5

Update your laravel/framework dependency to ^7.0 in your composer.json file.

In addition, update your nunomaduro/collision dependency to ^4.1,

phpunit/phpunit dependency to ^8.5,

facade/ignition to> `^2.0

After that as next step.

The report and render methods of your application's App\Exceptions\Handler class should accept instances of the Throwable interface instead of Exception instances:

use Throwable; // add this line

public function report(Throwable $exception); // replace Exception with Throwable
public function render($request, Throwable $exception); // replace Exception with Throwable

after that run

composer update
Pentastich answered 5/3, 2020 at 9:30 Comment(2)
This worked for me upgrading V6.20 to 7.30Imperious
This works. From V6 to V7. Two things I may add to this solution is. 1. Add Laravel UI. composer require laravel/ui "^2.0". 2. Optional, modify your composer to use either php 7 or 8. add this line to composer.json "php": "^7.2.5|^8.0"Obsessive
B
3

Update The following packages

"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5",

"laravel/ui": "^2.0",

"facade/ignition": "^2.0",

"laravel/framework": "^7.0",

for More clarity go to Guide

If Handle.php file error Check out Solution

Barbette answered 5/5, 2020 at 15:9 Comment(1)
i added ignition to my composer then edit handle and it worked for me thanksBashemath
K
1

As per Laravel Documentation to upgrade from laravel 6 to laravel 7

Update your laravel/framework dependency to ^7.0 in your composer.json file. In addition, update your nunomaduro/collision dependency to ^4.1, phpunit/phpunit dependency to ^8.5, and facade/ignition to `^2.0.

and then run composer update in your terminal

composer update

https://laravel.com/docs/7.x/upgrade

Karykaryl answered 4/3, 2020 at 6:40 Comment(0)
F
1

PHP 7.2.5 is required for laravel 7.0. Check the documentation

https://laravel.com/docs/7.x/upgrade

Fenny answered 4/3, 2020 at 7:21 Comment(0)
A
1

If you are get problems with this make sure you read ahead to this section and make the required changes. I found I HAD to make the changes in composer.json to get it to work. From the command line it just kept getting in a twist:

Authentication

Scaffolding Likelihood Of Impact: High

All authentication scaffolding has been moved to the laravel/ui repository. If you are using Laravel's authentication scaffolding, you should install the ^2.0 release of this package and the package should be installed in all environments. If you were previously including this package in the require-dev portion of your application's composer.json file, you should move it to the require section:

composer require laravel/ui "^2.0"

Adept answered 9/5, 2020 at 10:43 Comment(0)
A
0

You can follow below link having video/instructions to upgrade your Laravel 6 project to Laravel 7 :-

https://youtu.be/8gyAkicohsU

Ame answered 5/3, 2020 at 2:1 Comment(0)
U
0

I'm working on an existing code and it was like this on version 5.8 in /app/Exceptions/Handler.php:

 public function report(Exception $exception)
{
    parent::report($exception);
}

I changed use Exception; to use Throwable; and made this change

 public function report(Throwable $exception)
{
    parent::report($exception);
}

and it worked after changing every Exception to Throwable and updating all dependencies and language versions.

Ungraceful answered 19/7, 2021 at 11:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.