Skip to content

Commit

Permalink
Merge pull request #1 from huiyonghkw/master
Browse files Browse the repository at this point in the history
array_get is not support in laravel 6.x
  • Loading branch information
cyd622 committed Jan 13, 2022
2 parents 444cb84 + 6c2b46f commit e59a445
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
1 change: 1 addition & 0 deletions .php_cs.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"php":"7.2.24","version":"2.16.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true},"hashes":{"config\/config.php":1868915280,"resources\/views\/index.blade.php":4162280623,"routes\/web.php":2271466094,"src\/Echarts.php":2774331493,"src\/Http\/Controllers\/EchartsController.php":530074248,"src\/EchartsServiceProvider.php":4210772860}}
2 changes: 1 addition & 1 deletion config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
'view' => 'echarts::index',
'water_mark_text' => 'Cyd622@Laravel-Admin',
'theme' => 'shine',
];
];
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

use Encore\Admin\Widgets\Echarts\Http\Controllers\EchartsController;

Route::get('echarts', EchartsController::class.'@index');
Route::get('echarts', EchartsController::class.'@index');
5 changes: 2 additions & 3 deletions src/Echarts.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private function buildOption()
}

if (!$this->showToolbox) {
array_set($this->toolbox, 'show', false);
data_set($this->toolbox, 'show', false);
}

$this->dataSource = $this->dataSource ?: $this->data;
Expand Down Expand Up @@ -196,7 +196,6 @@ private function buildOption()
*/
public function bindLegend(array $data)
{

$this->dataSource = collect($this->data)->map(function ($item) use ($data) {
$tmp = [];
foreach ($data as $k => $v) {
Expand Down Expand Up @@ -369,4 +368,4 @@ public function setShowShadow(bool $showShadow)
$this->showShadow = $showShadow;
return $this;
}
}
}
3 changes: 1 addition & 2 deletions src/EchartsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public function boot(Echarts $extension)
}

if ($this->app->runningInConsole() && $assets = $extension->assets()) {

$this->publishes(
[$assets => public_path('vendor/laravel-admin-ext/echarts')],
'echarts'
Expand All @@ -46,4 +45,4 @@ public function boot(Echarts $extension)
Admin::headerJs('vendor/laravel-admin-ext/echarts/draw.js');
});
}
}
}
4 changes: 1 addition & 3 deletions src/Http/Controllers/EchartsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public function index(Content $content)
->header('Echarts demo')
->description('百度echarts图表展示')
->row(function (Row $row) use ($box, $box2, $box3, $box4) {

$row->column(6, function (Column $column) use ($box) {
$column->append($box);
});
Expand All @@ -105,7 +104,6 @@ public function index(Content $content)
$row->column(6, function (Column $column) use ($box4) {
$column->append($box4);
});

});
}
}
}

0 comments on commit e59a445

Please sign in to comment.