Skip to content

Commit 2b85636

Browse files
committed
Fix possible conflict with Laravel helpers.php file autoloading. Fix #330.
1 parent 43a5fb1 commit 2b85636

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
##Change Log
1010

11+
###v6.1.2
12+
- Fix possible conflict with Laravel helpers.php file autoloading. Fix #330.
13+
1114
###v6.1.1
1215
- Fix ordering when using basic array response. Fix #322.
1316

composer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
"phpunit/phpunit": "~4.0"
2727
},
2828
"autoload": {
29-
"files": [
30-
"src/fallback.php"
31-
],
3229
"psr-4": {
3330
"Yajra\\Datatables\\": "src/"
3431
}

src/DatatablesServiceProvider.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ private function registerCommands()
6565
*/
6666
public function register()
6767
{
68+
if ($this->isLumen()) {
69+
require_once 'fallback.php';
70+
}
71+
6872
$this->registerRequiredProviders();
6973

7074
$this->app->singleton('datatables', function ($app) {
@@ -74,6 +78,16 @@ public function register()
7478
$this->registerAliases();
7579
}
7680

81+
/**
82+
* Check if app uses Lumen.
83+
*
84+
* @return bool
85+
*/
86+
private function isLumen()
87+
{
88+
return str_contains($this->app->version(), 'Lumen');
89+
}
90+
7791
/**
7892
* Register 3rd party providers.
7993
*/

0 commit comments

Comments
 (0)