diff --git a/app/Http/Controllers/Common/Widgets.php b/app/Http/Controllers/Common/Widgets.php index aacfb897c..c56f8f5ce 100644 --- a/app/Http/Controllers/Common/Widgets.php +++ b/app/Http/Controllers/Common/Widgets.php @@ -17,9 +17,9 @@ class Widgets extends Controller */ public function index() { - $dashboard_widgets = Widget::enabled()->get(); + $widgets = Widget::enabled()->get(); - return response()->json($dashboard_widgets); + return response()->json($widgets); } /** @@ -33,7 +33,7 @@ class Widgets extends Controller $request['user_id'] = user()->id; $request['settings'] = [ - 'width' => $request->get('width') + 'width' => $request->get('width'), ]; $widget = Model::create($request->input()); @@ -52,7 +52,7 @@ class Widgets extends Controller 'settings' => $settings, 'sort' => $widget->sort, ], - 'redirect' => route('dashboard') + 'redirect' => route('dashboard'), ]); } @@ -88,7 +88,7 @@ class Widgets extends Controller $request['user_id'] = user()->id; $request['settings'] = [ - 'width' => $request->get('width') + 'width' => $request->get('width'), ]; $widget->update($request->input()); @@ -107,7 +107,7 @@ class Widgets extends Controller 'settings' => $settings, 'sort' => $widget->sort, ], - 'redirect' => route('dashboard') + 'redirect' => route('dashboard'), ]); } @@ -130,7 +130,7 @@ class Widgets extends Controller 'error' => false, 'message' => $message, 'data' => null, - 'redirect' => route('dashboard') + 'redirect' => route('dashboard'), ]); } diff --git a/app/Models/Common/DashboardWidget.php b/app/Models/Common/DashboardWidget.php index 443139022..3de81dd6d 100644 --- a/app/Models/Common/DashboardWidget.php +++ b/app/Models/Common/DashboardWidget.php @@ -6,7 +6,6 @@ use App\Abstracts\Model; class DashboardWidget extends Model { - protected $table = 'dashboard_widgets'; /** @@ -22,7 +21,7 @@ class DashboardWidget extends Model * @var array */ protected $casts = [ - 'settings' => 'array' + 'settings' => 'array', ]; public function user() @@ -57,7 +56,7 @@ class DashboardWidget extends Model $value['widget'] = $this; } else { $value = [ - 'widget' => $this + 'widget' => $this, ]; } diff --git a/app/Models/Common/Widget.php b/app/Models/Common/Widget.php index 7a2a98d50..f7994e632 100644 --- a/app/Models/Common/Widget.php +++ b/app/Models/Common/Widget.php @@ -31,7 +31,7 @@ class Widget extends Model * @var array */ protected $casts = [ - 'settings' => 'array' + 'settings' => 'array', ]; public function dashboard_widgets()