Exemplo n.º 1
0
 public function getUpdate($type, $act, $id = 0)
 {
     $nodes = \App\Node::top()->where('content_type', $type)->get();
     $article = new Article();
     $flag = 0;
     if ($act != 'add') {
         $flag = 1;
         $article = Article::find($id);
         if ($act == 'delete') {
             $url = \Request::header('Referer');
             $info = ['from' => 'del', 'status' => 'failed'];
             if ($article->delete()) {
                 $info['status'] = 'success';
                 j4flash($info);
                 return redirect($url);
             } else {
                 j4flash($info);
                 return redirect($url);
             }
         }
     }
     return view('admin.article.update', compact('flag', 'article', 'nodes'));
 }
Exemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex()
 {
     $navigates = Navigate::top()->get();
     $nodes = Node::top()->get();
     return view('admin.nav.index', compact('navigates', 'nodes'));
 }