I am working on Laravel 5.4 with PHP version 5.6.4.
My goal is to upgrade my project to Laravel 5.7 with PHP 7.1.
Now my question is: Do I have to upgrade to 5.5 > 5.6 > 5.7 or can I go directly from 5.4 to 5.7?
There are some articles on documentation. You can upgrade to 5.7 directly but be sure to modify critical sections from this links 5.5->5.6, 5.6->5.7. And make a backup of current project first
Better to upgrade 5.5 first an then go with 5.6 and 5.7 because if you see in 5.5 and 5.6 upgrade guide there are some packages also need to upgrade so you better go with the step by step.
5.4 to 5.5
5.5 to 5.6
5.6 to 5.7
For older versions, you can look at
5.3 to 5.4
4.2 to 5.3
From my point of view, it would help to upgrade step by step. This helps to to see whether your application is already compatible with all changes that need to be made.
If you upgrade to 5.7 directly and face larger problems due to the changes, your quickest option is to downgrade to 5.4 again.
If you upgrade to 5.5 in the first step, you can make your application compatible to 5.5, test it thoroughly, deploy it, and start to test what needs to be done for the upgrade to 5.6.
Just update your laravel/framework dependency to 5.7.* in your composer.json file. Since you are upgrading from 5.4 to 5.7, then you can easily just run
composer update
And if you modified some of Laravel's Traits or Methods in your 5.4 application, then you can check here for more info
Just update your laravel/framework dependency to 5.7.* in your composer.json file:
"require": {
"php": "^7.1.3",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.7.*",
"laravel/tinker": "^1.0"
},
After, run this command on your command prompt: composer update
You will achieve success and your Larvael will change to version 5.7, more details are available on upgrade guide
No,you sholud not upgrade step by step, only you can do this :
https://laravel.com/docs/5.7/upgrade
For updating Laravel 6.x (Which means any subversions to V6)
Just run this command
cd [laravel installation directory]
composer update
You must have composer installed on your VM or PC.
For Linux users only:
Composer directory must be owned by current user
//Check ownership
ls -la ~/ | grep ".composer"
//If you don't own the directory
chown -R [user]/[user] ~/.composer
Message me on any social media #smitpatelx Or leave a comment if you need any help or if your usecase differ from the above.
Related
Currently I am using Laravel 4.2.
I have tried this command - composer global require laravel/installer
It is installing the 4.2 Version itself. I need to update it to the latest version. Any suggestions..
My PHP version is 7.3
If you meant upgrade Laravel installer, just reinstall
composer global remove laravel/installer
composer global require laravel/installer
4.2 is the latest version of the installer(not the framework), you could install Laravel framework 8.0 using Laravel installer 4.2
https://packagist.org/packages/laravel/installer
You can create a Laravel 8 project using the below command:
laravel new example-app
cd example-app
php artisan --version
php artisan --version should show the latest version of the Laravel framework
If you meant to upgrade your current Laravel 4.2 project to 8.0, you need to upgrade to 5(5.0 - 5.8) first, then 6, then 7, and then 8.
Below is how to upgrade from 4.2 to 5.0
https://laravel.com/docs/5.0/upgrade#upgrade-5.0
But the path is too long, it's better to create new latest one and just copy-paste the route and controller.
As per the official laravel docs, the recommended way is to create a fresh laravel install and copy the unique application files from your old app to the newly created project
I've installed the admin package Voyager (without dummy data) on my Laravel project and when I want to create a user to access the admin panel with the following command: php artisan voyager:admin admin#admin.com --create, I get the following error:
After a little bit of searching, I found this link: https://github.com/the-control-group/voyager/issues/5082 => saying that this command does not work with PHP 7.4 and to make it work, I should either upgrade to PHP 7.4.1 or downgrade to PHP 7.3.
I'm using Wamp Server and decided to downgrade to PHP 7.3.12 since this version exists by default in C:\wamp64\bin\php
I have also edited composer.lock and composer.json in my project and then ran the command composer dump-autoload. But it still doesn't work. Am I missing something?
Had the same issue, upgraded to php 7.4.27 and it worked.
I've created my laravel project as follows:
laravel new my_app
This creates my project using laravel version 8. As I want to use Laravel 7, I modified composer.json:
"laravel/framework": "^7.0",
After that I run:
composer update
which ends with the error described (Class Illuminate\Support\Facades\RateLimiter not found )
In fact, that class doesn't exist in Support facade. Shouldn't downgrade process correct this?
No, this is from code in your application; specifically your App\Providers\RouteServiceProvider. Everything that isn't in vendor is considered your application and is not touched by any upgrade or downgrade. The laravel/laravel package only sets up your application skeleton for you. You can install Laravel 7 specifically with composer create-project --prefer-dist laravel/laravel:^7.0 yourproject; you can find the instructions in the install guide for Laravel 7.
Otherwise you will need to potentially copy the Service Providers from laravel/laravel version 7 into your application so you are not using providers from Laravel 8 as some things have changed and some new features were introduced. And there would be other changes as well.
Laravel 7.x Docs - Installation - via Composer Create-Project composer create-project
Im trying to add Monolog to a project which is running PHP version 5.6.3 and therefore its detecting the version and reverting.
On the documentation it saying
use Monolog ^1.0 for PHP 5.3+ support.
But I dont understand how is accomplished as a composer command.
Add this line in your composer.json file (in require section):
"monolog/monolog": "^1.0"
Then run composer install and you should be good to go!
I'm trying to install Laravel 4.1 using the Laravel installer but the docs isn't very descriptive.
Can someone please give a step by step guide on how to do this? I'm completely new to Laravel and PHP frameworks as a whole.
I'm on a Windows 7 machine running WAMP 2.2.
This information/answer isn't quite up to date anymore. The instructions here will install the latest version which is no longer 4.1. For those still wanting to install Laravel 4.1 (despite 4.2+ being out), use the following command.
composer create-project laravel/laravel project_name 4.1
You could replace the 4.1 with 4.0 or 4.2 depending on your situation.
Laravel 4.1 is handy if you aren't in control of your PHP version and you're stuck back on 5.3.7
Laravel 4.2 requires PHP 5.4.
When upgrading a project to a newer version of Laravel, be sure to review the release notes
Installing Laravel means simply downloading Laravel Application bootstrap, which has to be placed in your project directory. That application has a composer.json file, which will, after you run composer install command, download all necessary dependencies (including core framework).
That is one way. Another preferred way is directly through:
composer create-project laravel/laravel project_name
In both cases, you need to have composer installed on your machine. Composer is a modern PHP package manager, which has a ton of benefits (autoloading, custom commands...).
There is really no need for two downvotes, especially when this guy was reading documentation, which he couldn't understand. We were all installing Laravel for the first time.
If you want install laravel via Laravel Installer use this method:
First, open up command line. then enter:
composer global require "laravel/installer=~1.1"
Now go to:
C:\Users\ {User Name} \AppData\Roaming\Composer\vendor
Copy and paste vendor in your destination folder.
Now in your destination folder hold the shift key down and press right click and in opened navigation menu click on "open command window here" then enter command below:
laravel new your_project_destination
Ex:
laravel new laraveltest