v0.10.15k - Fixed admin access

This commit is contained in:
frederikpyt 2020-08-27 13:59:11 +02:00
parent 033d8f7c15
commit 78794074b2
1 changed files with 3 additions and 3 deletions

View File

@ -19,16 +19,16 @@ class RootController extends Controller
if(auth()->user()->can('admin.panel.show')) {
if(Response::detect("root.index")->name() == "admin.root.index")
return Response::detect("root.index");
return view("admin.root.index");
else {
$news = News::query()->orderBy('id', 'desc')->paginate($perPage);
return Response::detect("root.index", ["news" => $news]);
return view("app.root.index", ["news" => $news]);
}
}
else {
$news = News::query()->orderBy('id', 'desc')->paginate($perPage, ['*'], "page");
return view('app.root.index', ["news" => $news]);
return Response::detect('root.index', ["news" => $news]);
}
}
}