Inheritance: extends Controller
コード例 #1
0
ファイル: Role.php プロジェクト: johnsinapsis/sorefact
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next, $funcion)
 {
     $user = auth()->user();
     $menu = new MenuController();
     $count = $menu->box($funcion, $user->role);
     if ($count == 0) {
         abort(404, 'No tiene autorización para usar esta función');
     }
     return $next($request);
 }
コード例 #2
0
 public function pages($url)
 {
     $menu = MenuController::getMenu();
     $categorys = CategoryController::getCategory();
     $info = InfoController::getInfo();
     $convert = new convertString();
     $pages = PageController::getPageWhereUrl($url);
     if (count($pages) == 0) {
         return View::make("errors.404");
     }
     $header = array("title" => $pages[0]->name . "- phụ kiện thời trang", "keyword" => "Liên hệ-phụ kiện thời trang", "description" => "Liên hệ-phụ kiện thời trang");
     foreach ($info as $values) {
         if ($values->name == "keyword" && $values->contents != "") {
             $header["keyword"] = $values->contents;
         }
         if ($values->name == "description" && $values->contents != "") {
             $header["description"] = $values->contents;
         }
     }
     if (count($menu) > 0) {
         $menu = $this->ConvertMenuToArray($menu);
     }
     return view::make("page", array('menu' => $menu, "categorys" => $categorys, "info" => $info, "convert" => $convert, "header" => $header, "pages" => $pages));
 }