I am working on an existing application and the application is in laravel framework(version 5.2.45).And now i have to upgrade it to the version(5.4).I have follow the upgrade version step from laravel official documentation. Below is the steps which i have done :
1) Update the version number in laravel composer.json file in "laravel/framework" key.
2) Then after run the command composer update.
3) After that during executing the command i face error and the solution of that is to add the below line in composer.json file.
"minimum-stability": "dev",
"prefer-stable": true,
4) Then after again i execute the command composer update.Now i am facing the issue which i have attached in the below image :
Here is the code of composer.json file :
{
"name": "ozdemirburak/laravel-5-simple-cms",
"description": "Simple Laravel 5 content management system for starters.",
"keywords": [
"framework",
"laravel",
"cms"
],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.4.*",
"laravelcollective/html": "5.2.*",
"baum/baum": "~1.1",
"kris/laravel-form-builder": "1.6.*",
"laracasts/flash": "~1.3",
"mews/purifier": "~2.0",
"cviebrock/eloquent-sluggable": "~3.1.4",
"barryvdh/laravel-elfinder": "0.3.*",
"spatie/laravel-analytics": "~1.1",
"yajra/laravel-datatables-oracle": "~6.0",
"pingpong/modules": "~2.1",
"caffeinated/menus": "~2.0",
"fisharebest/laravel-assets": "~1.0",
"caffeinated/themes": "2.0.5",
"teepluss/theme": "dev-master",
"roumen/sitemap": "2.6.*",
"maatwebsite/excel": "^2.1",
"intervention/image": "^2.3",
"laravel/socialite": "^2.0",
"xinax/laravel-gettext": "^3.1",
"omnipay/paypal": " *",
"mews/captcha": "^2.2"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*",
"phpspec/phpspec": "~2.1",
"doctrine/dbal": "~2.5",
"squizlabs/php_codesniffer": "~1.5",
"laracasts/generators": "~1.1.3",
"barryvdh/laravel-ide-helper": "~2.0",
"barryvdh/laravel-debugbar": "~2.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/",
"Modules\\": "modules/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize",
"php artisan elfinder:publish"
]
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"preferred-install": "dist"
}
}
Note : For the current error i also found a solution in the stackoverflow and i implement that thing but still i am getting this error.
Thanks in advance!
You should update step by step, in your case update to 5.2 => 5.3 and after that 5.3 => 5.4 Please check laravel official documentation.
According to the error output:
"caffeinated/themes": "2.0.5" is locked to Laravel 5.1/5.2.
Upgrade that first.
Then the rest should follow.
Related
Actually Im trying to set API for my website on Laravel. I found that I need to add CreateFreshApiToken to Kernel.php in order to use it. Well, I wish could, but it doesn't exist. Then I have found I can get it via
composer require laravel/passport
I run it and have this one
composer require laravel/passport
./composer.json has been updated
Running composer update laravel/passport
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- artogrig/laravel-make-service[1.0.0, ..., 1.0.1] require illuminate/support ~5 -> found illuminate/support[v5.0.0, ..., 5.8.x-dev] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires artogrig/laravel-make-service ^1.0 -> satisfiable by artogrig/laravel-make-service[1.0.0, 1.0.1].
This is my comsposer.json:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5",
"artogrig/laravel-make-service": "^1.0",
"cviebrock/eloquent-sluggable": "^7.0",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"intervention/image": "^2.5",
"laravel/framework": "^7.0",
"laravel/passport": "^4.0",
"laravel/socialite": "^3.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.0",
"tcg/voyager": "^1.4"
},
"require-dev": {
"facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
},
"repositories": {
"hooks": {
"type": "composer",
"url": "https://larapack.io"
}
}
}
I have no idea what to do with. Could someone help me, please!
Thanks!
The dependency artogrig/laravel-make-service only works with Illuminate\Support 5, for what this package does, create service classes and is unmaintained. I would simply just remove it and your dependencies would be fixed.
I am trying to upgrade laravel to version 6 to php 7.4. How can I change the composer (its content is below) so that it pulls the plugins of compatible versions necessary for the project?
Compatibility errors occur when changing only laravel version
how do I understand which versions of plugins to write in composer so that it builds projects correctly? I have a lot of problems with him when changing versions ...
{
"name": "Codecast's Single Page Application Starter Kit",
"description": "This is the web service to support the kit.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*",
"barryvdh/laravel-cors": "0.8.*",
"tymon/jwt-auth": "~1.0",
"predis/predis": "~1.1",
"league/fractal": "0.14.*",
"jenssegers/agent": "^2.6"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*",
"squizlabs/php_codesniffer": "~2.3",
"scriptixru/sypexgeo": "0.2.*#dev"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/Support/",
"tests/TestCase.php",
"tests/ApiTestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
],
"test": "phpunit --colors=always",
"check-style": "phpcs -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 ./app ./config ./routes",
"fix-style": "phpcbf -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 ./app ./config ./routes"
},
"config": {
"preferred-install": "dist"
}
}
I want to Upgrade my Laravel project from (5.5 to 8) what I will do for that.
I didn't found any documents to upgrade from 5.5 to 8 just upgrade from 5.5 to 5.6 or from 7 to 8 maybe must upgrade the project step by step from 5.5 to 5.6 the from 5.6 to 5.7 then .... nutil 8
Thanks
composer.json(Laravel 5.5):
{
"name": "HomFolio",
"description": "Smart Property Investing",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.0",
"ext-json": "*",
"barryvdh/laravel-dompdf": "^0.8.1",
"barryvdh/laravel-translation-manager": "dev-master",
"fideloper/proxy": "~3.3",
"intervention/image": "^2.4",
"joedixon/laravel-translation": "^1.1",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0",
"stripe/stripe-php": "^4.7",
"zizaco/entrust": "dev-master"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~6.0",
"xethron/migrations-generator": "^2.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
composer.json (Laravel 8):
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0"
},
"require-dev": {
"facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
}
}
Looks like upgrades are sequential. As of today, I have a laravel 5.7 project that I have to upgrade to Laravel 8 and this looks like the sequence I need to take.
Even when you opt for the highly recommended Laravel Shift, you have to pay for each upgrade as indicated in the picture below.
.
If you have budget, laravel shift looks like a quick and easy way to go through the upgrade(s)
You have to follow the steps given below:
Copy the your current composer.json file.
Now go here https://github.com/laravel-shift/laravel-8.x/blob/master/composer.json and copy composer.json file and replace with your existing composer.json file.
Again go to https://github.com/laravel-shift/laravel-8.x/blob/master/app/Exceptions/Handler.php and copy the Handler.php file and go to app/exceptions/Handler.php replace Handler.php with your existing file.
Run the command composer update.
Check your old or your copied composer.json file and if packages have been added to it then you can add packages through this command composer require <package name>.
Now, again run composer update command.
You going to have to upgrade iteratively I'm afraid.
If you have the budget, you can use a service like Laravel Shift
to automate the upgrade.
Adding to some missing steps to #Krina Mangukiya
/bootstrap/environment.php :
$dotenv = Dotenv\Dotenv::createImmutable(DIR.'/..');
$dotenv->load();
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;
public function report(Throwable $exception); public function
render($request, Throwable $exception);
This answers have taken from stackoverflow only but would be go to have all issue answers in one place.
I have a Laravel 5.2.12 project (website), it's a big project and it's almost finished... Is there any simple way to update the Laravel from 5.2.12 to 5.2.31 without affecting the project (without affecting what was already done)? How can I do this?
So, the question is how to update the version of Laravel on existing project from 5.2.12 to 5.2.31?
EDIT: Here is my composer.json:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"cartalyst/sentinel": "2.0.*",
"intervention/image": "^2.3",
"barryvdh/laravel-debugbar": "^2.2",
"slynova/laravel-commentable": "^2.0",
"barryvdh/laravel-ide-helper": "v2.2.2"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
What should be changed to update just Laravel to 5.2.31 (to the latest 5.2 version)?
Update composer.json to use laravel\laravel on the version you would like. Then run composer update in you command line.
Your project should not have any issues updating from 5.2.12 to 5.2.31 since they are mostly bugfixes. But do note that other dependencies might update to a new version. So you might want to set them to a fixed version in your composer.json file if the cause hickups.
Getting the error on composer update command.
My composer.json file is:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"illuminate/html": "^5.0",
"barryvdh/laravel-debugbar": "~2.0",
"spatie/laravel-paginateroute": "^2.0",
"darkaonline/l5-swagger": "~2.0",
"yajra/laravel-datatables-oracle": "~5.0",
"phpoffice/phpexcel": "^1.8"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"symfony/dom-crawler": "~3.0",
"symfony/css-selector": "~3.0"
},
"autoload": {
"classmap": [
"database"
],
"files": ["app/Helpers/helpers.php"],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
You need to remove this outdated package (taken out of the core and no longer supported):
"illuminate/html": "^5.0",
When you remove it, you need to also remove its service providers / aliases. So, if you open up config/app.php, you will see a providers and aliases section. Remove these lines of code if you haven't done so already.
'Illuminate\Html\HtmlServiceProvider'
'Form'=> 'Illuminate\Html\FormFacade',
'HTML'=> 'Illuminate\Html\HtmlFacade',
In place of it, you should install the Laravel collective package. To install that, replace the illuminate/html package with this:
"laravelcollective/html": "5.2.*"
Then in your config/app.php file, add this to your providers array:
Collective\Html\HtmlServiceProvider::class
and this to your aliases array:
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
The docs can be found here: https://laravelcollective.com/docs/5.2/html
Look at this
https://laracasts.com/discuss/channels/laravel/call-to-undefined-method-illuminatefoundationapplicationbindshared
Quote "bindShared has been renamed to $app->singleton()"
[Edit]
I think you have something is your own custom code what need to be changed from : $this->app->bindShared() to: $this->app->singleton().
I solved it by the steps mentioned in Link1 Link2
After the upgrade please make sure all the Deprecations mentioned in Link2 are corrected in your current app. For me Illuminate\Contracts\Routing\Middleware had to be removed from all the Middlewares.
Also I had to install latest version of certain packages like "yajra/laravel-datatables-oracle": "~6.1.1",