本文介绍了找不到作曲家Laravel类'yajra \ Datatables \ DatatablesServiceProvider'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在laravelcomposer package上遇到问题 yajra/laravel-datatables 这是我来自composer.json的要求部分:

I have a problem with laravel and composer package yajra/laravel-datatablesHere is my require part from composer.json:

"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.2.*",
    "cartalyst/sentinel": "^2.0",
    "laravelcollective/html": "^5.2",
    "yajra/laravel-datatables-oracle": "^6.1"
},

执行composer update后,一切顺利,我可以检查内部供应商目录是否已出现yajra文件夹.之后,我在app.php中添加了新的提供程序:

After executing composer update all passes fine and I can check that inside vendor dir has appeared yajra folder.After that I have add new provider in app.php:

yajra\Datatables\DatatablesServiceProvider::class

,然后运行php artisan,但控制台中出现followingerror:

and then run php artisan but followingerror appears in the console:

Class 'yajra\Datatables\DatatablesServiceProvider' not found

我可以通过编辑autoload_classmap.php文件并手动添加

I can fix this error by editing autoload_classmap.php file and manually add

'yajra\\Datatables\\DatatablesServiceProvider' => $vendorDir . '/yajra/laravel-datatables-oracle/src/DatatablesServiceProvider.php',

无论如何,下次我执行作曲家更新时,此行将被删除,并再次出现相同的错误,因此我再次必须手动编辑autoload_classmap.php文件.

Anyway, the next time I execute composer update this line is deleted and again appears the same error and I again have to manually edit autoload_classmap.php file.

出了点问题,导致composer update无法更新相关的自动加载文件.我不知道发生了什么事.

There is something wrong which causes composer update to not update relevant autoload files. I can not get it what is going on.

推荐答案

您应该在app.php

Yajra\Datatables\DatatablesServiceProvider::class

代替

yajra\Datatables\DatatablesServiceProvider::class

(带有大写字母)

这篇关于找不到作曲家Laravel类'yajra \ Datatables \ DatatablesServiceProvider'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 14:23