v1.3.3 - Added comments and removed code

This commit is contained in:
frederikpyt
2020-09-22 08:56:03 +02:00
parent 13197b8be8
commit cc3d78200a
11 changed files with 31 additions and 61 deletions
@@ -18,8 +18,10 @@ class RootController extends Controller
public function index() {
$perPage = 5;
//All news
$newsCollection = News::query()->orderBy('id', 'desc')->paginate($perPage);
//Runs through all the news and deletes the old stuff
foreach ($newsCollection as $new)
{
if($new->type_id == 3)
@@ -27,6 +29,7 @@ class RootController extends Controller
$new->delete();
}
//Return either the admin or app index page without the old news
if(auth()->user()->can('admin.panel.show')) {
if(Response::detect("root.index")->name() == "admin.root.index")
return view("admin.root.index");