changed dashboard assignment
This commit is contained in:
parent
1934b93353
commit
df03edcfff
@ -89,8 +89,6 @@ class Login extends Controller
|
|||||||
return response()->json($response);
|
return response()->json($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
session(['dashboard_id' => $user->dashboards()->enabled()->pluck('id')->first()]);
|
|
||||||
|
|
||||||
$response = [
|
$response = [
|
||||||
'status' => null,
|
'status' => null,
|
||||||
'success' => true,
|
'success' => true,
|
||||||
|
@ -51,12 +51,10 @@ class Dashboards extends Controller
|
|||||||
{
|
{
|
||||||
$dashboard_id = $dashboard_id ?? session('dashboard_id');
|
$dashboard_id = $dashboard_id ?? session('dashboard_id');
|
||||||
|
|
||||||
if (empty($dashboard_id)) {
|
|
||||||
$dashboard_id = user()->dashboards()->enabled()->pluck('id')->first();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($dashboard_id)) {
|
if (!empty($dashboard_id)) {
|
||||||
$dashboard = Dashboard::find($dashboard_id);
|
$dashboard = Dashboard::find($dashboard_id);
|
||||||
|
} else {
|
||||||
|
$dashboard = user()->dashboards()->enabled()->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($dashboard)) {
|
if (empty($dashboard)) {
|
||||||
@ -67,6 +65,8 @@ class Dashboards extends Controller
|
|||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
session(['dashboard_id' => $dashboard->id]);
|
||||||
|
|
||||||
$widgets = Widget::where('dashboard_id', $dashboard->id)->orderBy('sort', 'asc')->get()->filter(function ($widget) {
|
$widgets = Widget::where('dashboard_id', $dashboard->id)->orderBy('sort', 'asc')->get()->filter(function ($widget) {
|
||||||
return Widgets::canShow($widget->class);
|
return Widgets::canShow($widget->class);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user