middleware("auth"); $this->middleware([ "lang" ]); } public function index() { $perPage = 2; if(auth()->user()->can('admin.panel.show')) { if(Response::detect("root.index")->name() == "admin.root.index") return Response::detect("root.index"); else { $news = News::query()->orderBy('id', 'asc')->paginate($perPage); return Response::detect("root.index", ["news" => $news]); } } else { $news = News::query()->orderBy('id', 'asc')->paginate($perPage); return view('app.root.index', ["news" => $news]); } } }