示例#1
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create($id)
 {
     $model = new Article();
     $articles = $model->paginateArticles(["Portal_id" => $id], 5, 'id', 'desc');
     $model = new Portal();
     while ($hasParent[] = $model->getPortal(["id" => $id], ["parent", "name"])) {
         $current = current($hasParent);
         $id = $current->parent;
     }
     unset($hasParent[count($hasParent) - 1]);
     $hasParent = array_reverse($hasParent);
     return view("portal.index", ["all" => $articles, "hasParent" => $hasParent]);
 }
示例#2
0
 public function modifyportal(Request $request)
 {
     $id = $request->get('id', null);
     $portal_model = new Portal();
     $portal = $portal_model->getPortal(['id' => $id]);
     $data = ['id' => $id, 'portal' => $portal];
     return view('ajax/admin/mportal', $data)->renderSections();
 }