Example #1
0
 /**
  * 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);
 }
Example #2
0
 /**
  * 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);
     }
 }
Example #3
0
 public function displayNews()
 {
     $news = News::get();
     return view('administration.news.display', ['news' => $news]);
 }
Example #4
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $this->data['news'] = News::get();
     return view('admin.news.manage', $this->data);
 }