Skip to content

Commit 5e8570d

Browse files
Add support Laravel 6.0 & remove deprecated functions
1 parent 42c8178 commit 5e8570d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"yajra/laravel-datatables-oracle": "8.*|9.*",
2020
"yajra/laravel-datatables-html": "3.*|4.*",
2121
"maatwebsite/excel": "^3.0",
22-
"illuminate/console": "^5.5"
22+
"illuminate/console": "^5.5|^6.0"
2323
},
2424
"require-dev": {
2525
"mockery/mockery": "~1.0",

src/Generators/DataTablesMakeCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ protected function getModel()
7777
$modelNamespace = $this->option('model-namespace') ? $this->option('model-namespace') : $this->laravel['config']->get('datatables-buttons.namespace.model');
7878

7979
return $model
80-
? $rootNamespace . '\\' . ($modelNamespace ? $modelNamespace . '\\' : '') . str_singular($name)
80+
? $rootNamespace . '\\' . ($modelNamespace ? $modelNamespace . '\\' : '') . Str::singular($name)
8181
: $rootNamespace . '\\User';
8282
}
8383

src/Transformers/DataArrayTransformer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Yajra\DataTables\Transformers;
44

5+
use Illuminate\Support\Arr;
56
use Illuminate\Support\Collection;
67

78
class DataArrayTransformer
@@ -20,7 +21,7 @@ public function transform(array $row, $columns, $type = 'printable')
2021
return $this->buildColumnByCollection($row, $columns, $type);
2122
}
2223

23-
return array_only($row, $columns);
24+
return Arr::only($row, $columns);
2425
}
2526

2627
/**
@@ -37,7 +38,7 @@ protected function buildColumnByCollection(array $row, Collection $columns, $typ
3738
foreach ($columns->all() as $column) {
3839
if ($column[$type]) {
3940
$title = $column['title'];
40-
$data = array_get($row, $column['data']);
41+
$data = Arr::get($row, $column['data']);
4142
if ($type == 'exportable') {
4243
$title = $this->decodeContent($title);
4344
$dataType = gettype($data);

0 commit comments

Comments
 (0)