I’m trying to install yajra/laravel-datatables-oracle using the command:
composer require yajra/laravel-datatables-oracle
But I’m getting the following error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- yajra/laravel-datatables[dev-master, v9.0.0] require yajra/laravel-datatables-oracle 10.* -> satisfiable by yajra/laravel-datatables-oracle[v10.0.0, ..., 10.x-dev (alias of dev-master)].
- yajra/laravel-datatables-oracle 10.x-dev is an alias of yajra/laravel-datatables-oracle dev-master and thus requires it to be installed too.
- yajra/laravel-datatables-oracle[dev-master, v10.0.0, ..., v10.1.2] require illuminate/database ^9 -> found illuminate/database[v9.0.0-beta.1, ..., 9.x-dev] but these were not loaded, likely because it conflicts with another require.
- yajra/laravel-datatables 9.0.x-dev is an alias of yajra/laravel-datatables dev-master and thus requires it to be installed too.
- Root composer.json requires yajra/laravel-datatables ^9.0 -> satisfiable by yajra/laravel-datatables[v9.0.0, 9.0.x-dev (alias of dev-master)].
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
My laravel framework version is v8.83.22.
Bellow is my composer.json file showing all my dependencies and requirements
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"barryvdh/laravel-dompdf": "^1.0.0",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"intervention/image": "^2.6",
"jimmyjs/laravel-report-generator": "^2.1",
"laravel/framework": "^8.54",
"laravel/sanctum": "^2.11",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.3",
"laraveldaily/laravel-invoices": "3.0",
"pragmarx/tracker": "^4.0",
"rap2hpoutre/fast-excel": "^4.0",
"simplesoftwareio/simple-qrcode": "^4.2"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.6",
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3"
},
"autoload": {
"psr-4": {
"App\": "app/",
"Database\Factories\": "database/factories/",
"Database\Seeders\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\Foundation\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi"
],
"post-root-package-install": [
"@php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
Note that the requirements are just the minimum such as php from which I have version 8.0.8 installed and laravel framework is v8.83.22
2
Answers
The most recent version of that particular package is
10.x
which is only supported by Laravel9.x
and above.The
composer require
you’re using will pull in version10.x
which isn’t supported by your Laravel 8 installation, therefore provide composer with the specific version of the package that is supported for Laravel8.x
:You can check version compatibility on the package GitHub page.
As a user mentioned, you need to use the previous version (9) because the latest one (10) is only supporting
Laravel 9.x+
and you are usingLaravel 8.x
.I also saw you mentioned:
That means you are using
PHP 8.0
butyajra/laravel-datatables-oracle:^9.0
only supports7.1 <= PHP > 8.0
, so instead use this one:That version’s
composer.json
is like this:Meaning that it will allow you to use any Laravel >= 5.8.x but also allow you to use
PHP >= 7.1
.Yajra version 9.0
composer.json
did not support that before, that is why it is failing for you:You can see it only supported Laravel 5.8 and
7.1 <= PHP > 8.0