Exemplo n.º 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);
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 3
0
 public function displayNews()
 {
     $news = News::get();
     return view('administration.news.display', ['news' => $news]);
 }
Exemplo n.º 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);
 }