/** * Display a listing of the resource. * * @return Response */ public function index() { $this->data = array(); $this->data['artikel'] = Artikel::get(); $this->data['news'] = News::get(); return view('home', $this->data); }
/** * Get ID and titles of all news articles * * @return Response */ public function getEditableNews(Request $request) { $user = User::find(Auth::user()->id); if ($user->webadmin == 1) { $news = \App\News::get(array('id', 'title', 'author')); return $news; } else { return response()->json(['error' => 'invalid_credentials'], 401); } }
public function displayNews() { $news = News::get(); return view('administration.news.display', ['news' => $news]); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $this->data['news'] = News::get(); return view('admin.news.manage', $this->data); }