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"
}
}
Related
What I tried:
composer require laravel/ui
composer require laravel/ui:^3.2
Directly update composer.json and composer update
All of the tries above ended up the error below.
[InvalidArgumentException]
Could not find package laravel/ui.
Did you mean this?
laravel/ui
Versions:
root#e89196703687:/work/backend# php artisan -V
Laravel Framework 8.11.0
root#e89196703687:/work/backend# php -v
PHP 7.4.13 (cli) (built: Dec 11 2020 08:31:11) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
composer.jsn
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.3",
"auth0/login": "^6.1",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.0",
"laravel/tinker": "^2.0"
},
"require-dev": {
"facade/ignition": "^2.3.6",
"friendsofphp/php-cs-fixer": "^2.16",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"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"
],
"post-install-cmd": [
"php artisan clear-compiled",
"chmod -R 775 public/"
],
"fix": [
"php-cs-fixer fix"
]
}
}
Any idea?
To install, you must use the following command. Composer will update according to the package version
composer require laravel/ui:*
try this code:
composer require laravel/ui:^3.0
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.
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.
I am using Laravel version 5.2 and Jenssegers MongoDB. I installed both and working fine but I have to use any other library and made changes in composer.json after that use command composer update. After using this command automatically Jenssegers MongoDB file removed. I don't know why this happen. After composer update why Jenssegers MongoDB file removed automatically? Please suggest me how to handel this?
My composer.json file
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"acacha/admin-lte-template-laravel": "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/"
},
"files": [
"app/common_helper.php"
]
},
"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": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
Write this "jenssegers/mongodb": "*", line in your composer.json file:-
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"acacha/admin-lte-template-laravel": "2.*",
"jenssegers/mongodb": "*",
},
And add the service provider in config/app.php
Jenssegers\Mongodb\MongodbServiceProvider::class,
Jenssegers\Mongodb\Auth\PasswordResetServiceProvider,
then go to project root directory in terminal and run command composer update .
In model file, you need to add below line at the top,
use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
Reference :- documentation
composer update --no-scripts
you can stop scripts run
Currently stumped on a test that is returning a 503 error for no reason. Running Laravel 5.1 and latest PHPUnit.
The test:
$this->call('GET', '/about');
$this->assertResponseStatus(200);
Fails because it returns a 503 error, other tests (similar GET calls) pass.
If I dd($this->call()) I can see the entire html response is returned but still has a 503 error attached. No errors in the logs either. The page loads fine in a browser, no 503 error.
edit:
Route::group(array('after' => 'cache:1440'), function() {
Route::get('about', 'HomeController#showAbout');
}
edit2:
dd($this->call('GET', '/about'));
yields full html+
version: "1.1"
statusCode: 503
statusText: "Service Unavailable"
charset: null
composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"laravelcollective/html": "~5.0",
"intervention/image": "dev-master",
"watson/sitemap": "2.0.*",
"rap2hpoutre/laravel-log-viewer": "dev-master",
"barryvdh/laravel-httpcache": "0.2.x#dev",
"guzzlehttp/guzzle": "~5.3|~6.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database",
"app/Http/Controllers",
"app/Models",
"app/Helpers"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"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"
},
"minimum-stability": "dev",
"prefer-stable": true
}
Alright I found the issue for some reason flushing and clearing the cache did not work for the barryvdh\laravel-httpcache library, I had to manually delete everything under storage/httpcache