skip to Main Content

i have a project since 3 years on Laravel 7 on GitHub, i clone the project to my localhost, now i want to upgrade the project to Laravel 10. I get tired to do composer update and npm run dev and npm run dev and php artisan key:generate , i get a fatel error.
my composer.json:

        "php": "^7.2.5",
        "barryvdh/laravel-dompdf": "^0.8.6",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^1.0",
        "guzzlehttp/guzzle": "^6.3",
        "imliam/laravel-env-set-command": "^1.0",
        "laravel/framework": "^7.0",
        "laravel/socialite": "^4.3",
        "laravel/tinker": "^2.0",
        "maatwebsite/excel": "^3.1",
        "mcamara/laravel-localization": "^1.5",
        "milon/barcode": "^7.0",
        "nesbot/carbon": "^2.36",
        "predis/predis": "^1.1",
        "pusher/pusher-php-server": "~4.0",
        "tymon/jwt-auth": "^1.0"
    },
    "require-dev": {
        "facade/ignition": "^2.0",
        "fzaninotto/faker": "^1.9.1",
        "laravel/ui": "^2.0",
        "mockery/mockery": "^1.3.1",
        "nunomaduro/collision": "^4.1",
        "phpunit/phpunit": "^8.5"

i download xampp from near, my php version is 8.1
help me please

3

Answers


  1. The main reason why you can’t find the .env file is because it’s added to the .gitignore file. After installing the composer packages, try running:

    composer require maatwebsite/excel:^3.0.1
    Please make sure to use the compatable version of the Excel package based on your Laravel version.

    Login or Signup to reply.
  2. As, you’re getting fatal error for the command:

    php artisan key:generate
    

    Then, most probably you might forgot the create an .env file. Just copy the .env.example file and change the file name and its contents. Then run the command again.

    N.B.: You should install the dependencies with composer before key generation.

    Login or Signup to reply.
  3. You say you have PHP 8.1 and your project has Laravel 7 and dependencies from around that time.

    It’s very possible that a lot of your dependencies are simply not compatible with your current PHP version.

    You should upgrade gradually, following the upgrade guides in order.

    According to wikipedia1, Laravel 8 should be compatible with 8.1. If you want to install dependencies regardless of compatibility, append the --ignore-platform-reqs to your composer commands. For example:

    composer update --ignore-platform-reqs
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search