Laravel-Backpack / CRUD

Build custom admin panels. Fast!
https://backpackforlaravel.com
MIT License
3.08k stars 885 forks source link

Installing 4.1 on Laravel 8 #3403

Closed MikePageDev closed 3 years ago

MikePageDev commented 3 years ago

Bug report

What I did

Ran

composer require backpack/crud:"4.1.*

to install on Laravel 8

What I expected to happen

It to install

What happened

Received the following error.

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

  Problem 1
    - backpack/crud[4.1.22, ..., 4.1.x-dev] require doctrine/dbal ^2.5 -> found doctrine/dbal[v2.5.0-BETA2, ..., 2.12.x-dev] but it conflicts with your root composer.json require (^3.0).
    - backpack/crud[4.1.0, ..., 4.1.21] require laravel/framework ^7.0|^6.0 -> found laravel/framework[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but it conflicts with your root composer.json require (^8.12).
    - Root composer.json requires backpack/crud 4.1.* -> satisfiable by backpack/crud[4.1.0, ..., 4.1.x-dev].

What I've already tried to fix it

I have tried to google for a solution but not found one.

Backpack, Laravel, PHP, DB version

Laravel 8.17 PHP 7.3.24

welcome[bot] commented 3 years ago

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication channels:

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

-- Justin Case The Backpack Robot

tabacitu commented 3 years ago

Hmm... that's odd. I just installed Backpack on a fresh Laravel project and it worked fine. @MikePageDev what does your composer.json look like?

MikePageDev commented 3 years ago

I have fixed this by removing doctrine/dbal and installing

nihadatakishiyev commented 3 years ago

I experienced similar conflict problem when trying to install doctrine/dbal to my Laravel 8 project in which backpack is already installed. Any idea why would that happen? @tabacitu

error

I also attach a copy of my composer.json file. Thanks in advance!

composer.txt

lotarbo commented 3 years ago

I have same problem, quick fix for me - remove composer.lock file 😁

History: i have already workink project and wanna adds admin panel, when run composer require backpack/crud:"4.1.*" it make error image composer.json

"require": {
        "php": "^7.3",
        "ext-imagick": "*",
        "cerbero/laravel-enum": "^1.3",
        "endroid/qr-code": "^3.9",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel-lang/lang": "~7.0",
        "laravel/framework": "^8.0",
        "laravel/sanctum": "^2.6",
        "laravel/tinker": "^2.0",
        "revolution/laravel-google-sheets": "^5.3"
    },
    "require-dev": {
        "roave/security-advisories": "dev-master"
        ,
        "barryvdh/laravel-ide-helper": "^2.8",
        "facade/ignition": "^2.3.6",
        "fzaninotto/faker": "^1.9.1",
        "mockery/mockery": "^1.3.1",
        "nunomaduro/collision": "^5.0",
        "phpunit/phpunit": "^9.3"
    },
nihadatakishiyev commented 3 years ago

Deleting composer.lock solved the first problem, however problem 2 still persists.

error

tabacitu commented 3 years ago

Hi guys,

Indeed, Laravel 8 supports PHP 8, but it also supports both DBAL v2.5+ and DBAL v3.x. Backpack does support PHP 8 in the latest version, but it does not yet support DBAL v3 (see https://github.com/Laravel-Backpack/CRUD/pull/3517). We do plan to add DBAL v3 support but it could take a few days - and depending on what we find it's possible that it'll be a breaking change.

If you don't have a reason to explicitly ask for DBAL v3 (you don't use DBAL v3 features in your code), I recommend you remove the doctrine/dbal composer dependency in your project and run composer update - that should have the same result as @lotarbo and @MikePageDev 's solution. Doctrine/dbal v2.12.x does support PHP 8, so it should work just fine.

If you have a dependency that needs DBAL v3, however, since Backpack doesn't yet support DBAL v3... that's where you have a problem. The only thing to do in that case is to wait from upgrading that dependency, until we manage to add DBAL v3 support in Backpack. Hopefully we'll be able to do so in a non-breaking manner 🤞

Cheers!