pimlie / laravel-datatables-mongodb

Laravel DataTables plugin to support Laravel Mongodb
MIT License
12 stars 15 forks source link

Composer install Error - camel_case() not found #4

Closed SKFrozenCloud closed 4 years ago

SKFrozenCloud commented 4 years ago

When I try to install the package (with all the necessary requirements already installed and configured): composer require pimlie/laravel-datatables-mongodb:^1.1 -v

I get an error:

Symfony\Component\Debug\Exception\FatalThrowableError : Call to undefined function Pimlie\DataTables\camel_case()

at /opt/lampp/htdocs/site/vendor/pimlie/laravel-datatables-mongodb/src/MongodbDataTablesServiceProvider.php:31

27|             $this->app['config']->set('datatables.engines', array_merge(static::$engines, $engines));
28|         }
29|         
30|         foreach (static::$engines as $engine => $class) {
31|             $engine = camel_case($engine); // This line is the error
32| 
33|             if (!DataTables::hasMacro($engine)) {
34|                 DataTables::macro($engine, function () use ($class) {
35|                     if (!call_user_func_array(array($class, 'canCreate'), func_get_args())) {

Exception trace:

1 Pimlie\DataTables\MongodbDataTablesServiceProvider::boot() /opt/lampp/htdocs/site/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32

2 call_user_func_array([]) /opt/lampp/htdocs/site/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32

SKFrozenCloud commented 4 years ago

Also here is a dump of static::$engines which is split into $engine => $class

dd($engine);

array:3 [
    "moloquent" => "Pimlie\DataTables\MongodbDataTable"
    "mongodb-query" => "Pimlie\DataTables\MongodbQueryDataTable"
    "mongodb-hybrid" => "Pimlie\DataTables\HybridMongodbQueryDataTable"
]

Update: I commented the line and it installed without any errors. I don't know if anything is broken though.

flavioccf commented 4 years ago

I'm having the same issue when installing via composer

Call to undefined function Pimlie\DataTables\camel_case() at \vendor\pimlie\laravel-datatables-mongodb\src\MongodbDataTablesServiceProvider.php:31