-
-
Notifications
You must be signed in to change notification settings - Fork 853
Description
Code snippet of problem
DataTables::of($query)->make(true);System details
- Operating System: Red Hat Enterprise Linux release 9.7 (Plow)
- PHP Version: 8.2.29
- Laravel Version: laravel/framework: v12.41.1
- Laravel-Datatables Version: v12.6.2
Cause
We use a customized ConfigRepository class which extends PersistentRepository from illuminatech/config, 1.4.3. The PersistentRepository class implements Illuminate\Contracts\Config\Repository, which does not define typed retrieval methods such as array().
As a result, when your library calls $config->array(), see DataTables.php, it fails if the configuration repository implements only the contract and not the concrete Laravel repository class.
Expected Behavior / Suggestion
As a third-party Laravel library, it's safest to assume that "Config" (i.e., Illuminate\Support\Facades\Config) will provide an implementation of Illuminate\Contracts\Config\Repository, but not necessarily Illuminate\Config\Repository. Therefore, please avoid using typed retrieval methods not defined on the contract, such as array(), in your code.
BTW, thanks for creating such a great library!