简体   繁体   English

Laravel 5.7:Laravel Datatable未随Composer一起安装

[英]Laravel 5.7: Laravel Datatable is not installing with Composer

Trying to Install Laravel Datatable with this command with Composer: 尝试通过Composer使用此命令安装Laravel Datatable

composer require yajra/laravel-datatables-oracle:^8.0

But nothing is loading. 但是什么都没有加载。

When I am updating composer then it is hanging with this info: 当我更新作曲家时,它会挂起以下信息:

> Loading composer repositories with package information Updating
> dependencies (including require-dev)

Composer.json Composer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0",
        "spatie/laravel-permission": "^2.20",
        "yajra/laravel-datatables-oracle": "^8.9"
    },
    "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/"
        }
    },
    }

Use this: 用这个:

composer require yajra/laravel-datatables-oracle

After successfully install package, open config/app.php file and add service provider and alias. 成功安装软件包后,打开config / app.php文件并添加服务提供商和别名。

config/app.php
'providers' => [
     Yajra\Datatables\DatatablesServiceProvider::class,
],

'aliases' => [
    'Datatables' => Yajra\Datatables\Facades\Datatables::class,
]

Please visit the link Datatable with 5.7 for more info 请访问链接5.7的数据表以获取更多信息

I just run the code in my pc. 我只是在我的电脑上运行代码。 Please check it. 请检查一下。 在此处输入图片说明

At last it has worked. 终于成功了。

composer config --global repo.packagist composer https://packagist.org

After running this command I have run this below command 运行此命令后,我已在下面运行此命令

composer require yajra/laravel-datatables-oracle

then installed the package within 2 minutes. 然后在2分钟内安装好软件包。

First check if there is a composer.lock file is there, if it is, then it will bind you to those specific packages. 首先检查是否有一个composer.lock文件,如果存在,那么它将把您绑定到那些特定的软件包。 If you want to install it, then remove composer.lock and then re-try the process and it will download the package. 如果要安装它,请删除composer.lock,然后重试该过程,它将下载该软件包。

Make sure to share the composer.lock among your peers via git or something similar, so that all are using the same package and same version. 确保通过git或类似方式在同伴之间共享composer.lock,以便所有人都使用相同的软件包和相同的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM