ErrorException Return value of Spatie\Dashboard\Dashboard::getTheme() must be of the type string, null returned (View: E:\solaarslide\resources\views\dashboard\index.blade.php)
mohsulthana opened this issue · 1 comments
mohsulthana commented
I have followed the installation guide but I found this error
ErrorException Return value of Spatie\Dashboard\Dashboard::getTheme() must be of the type string, null returned (View: E:\solaarslide\resources\views\dashboard\index.blade.php)
Here's my controller
`public function index($folderName, $fileName, $id=false)
{
$id_user = session('user')['id'];
$list_panel = Panel::where('id_user', $id_user)->get();
$panel = null;
$user = null;
$energy = null;
$user_widget = [];
if($id) {
$panel = Panel::where(['id' => $id, 'id_user' => $id_user])->firstOrFail();
$user_have_widget = PanelWidget::where('panel_id', $id)->get();
foreach ($user_have_widget as $have) {
$tmp = Widgets::firstWhere('id', $have['widget_id']);
array_push($user_widget, [
'id' => $tmp['id'],
'order' => $have['order'],
'content' => $tmp['content'],
'image' => $tmp['image'],
'graph_type' => $tmp['graph_type'],
'graph_source' => $tmp['graph_source'],
'status' => $tmp['status']
]);
}
$energy = $this->getData($id_user);
if($energy===false) {
return 'FTP connection error';
}
}
// Render perticular view file by foldername and filename
if (view()->exists($folderName . "." . $fileName)) {
return view($folderName . "." . $fileName, compact('energy', 'panel', 'list_panel', 'user', 'user_widget'));
}
return abort(404);
}`
nielsdrost7 commented
I would say that the config is not published.
It's looking for $defaultTheme = config('dashboard.theme'); and when you debug that on your end It's probably empty or non-existent