Yajra DataTable 未在 Laravel 5.7 上安装。*

Yajra DataTable Is Not Installing on Laravel 5.7.*

我在 Powershell 上使用此命令“composer require yajra/laravel-datatables:^1.0”安装 Yajra Datatable 时遇到问题,我遇到了错误。我卸载了 Wampp 并安装了 Xampp 但问题仍然存在。请帮我弄清楚为什么会发生这种情况是任何 PHP 版本问题或其他问题。我从两天前开始解决这个问题,但我失败了。

问题代码片段

问题 1

这是我的Composer.json

{

"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": "^7.1.3",
    "emotality/tawk-laravel": "^1.0",
    "fideloper/proxy": "^4.0",
    "laravel/framework": "5.7.*",
    "laravel/tinker": "^1.0",
    "spatie/laravel-newsletter": "^4.2",
    "yajra/laravel-datatables": "1.0",

},

"require-dev": {
    "beyondcode/laravel-dump-server": "^1.0",
    "filp/whoops": "^2.0",
    "fzaninotto/faker": "^1.4",
    "mockery/mockery": "^1.0",
    "nunomaduro/collision": "^2.0",
    "phpunit/phpunit": "^7.0"
},

"autoload": {
    "classmap": [
        "database/seeds",
        "database/factories"
    ],
    "psr-4": {
        "App\": "app/"
    }
},
"autoload-dev": {
    "psr-4": {
        "Tests\": "tests/"
    }
},
"extra": {
    "laravel": {
        "dont-discover": [
        ]
    }
},
"scripts": {
    "post-root-package-install": [
        "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "@php artisan key:generate"
    ],
    "post-autoload-dump": [
        "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
        "@php artisan package:discover"
    ]
},
"config": {
    "preferred-install": "dist",
    "sort-packages": true,
    "optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}

系统详情

操作系统Windows

PHP 7.2.11

Laravel 版本 5.7.12

Laravel-Datatables 版本 ^1.0

我刚遇到这个问题,只是 运行 这个命令。

composer require yajra/laravel-datatables

应安装最新版本的软件包,或添加此行

"yajra/laravel-datatables": "^1.2"

到composer.json然后运行

composer update

由于 yajra/laravel-datatables-oracle,我在将 laravel 从 5.7 更新到 5.8 时遇到了问题。我从 composer.json 中删除了这个包,用 composer update 更新了 laravel,然后 composer require yajra/laravel-datatables-oracle