Exemplo n.º 1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     if (Auth::check() && $this->rolechucnangs && $this->rolechucnangs->Sua == 1) {
         $roles = Role::all();
         $chucnangs = Danhmucchucnang::orderBy('orders')->get();
         $rolechucnangs = RoleChucnang::where('role_id', $id)->get();
         $role = Role::findOrFail($id);
         //echo '<pre>';
         //print_r($rolechucnangs);
         return view('role.edit')->with(array('menus' => $this->menus, 'roles' => $roles, 'role' => $role, 'chucnangs' => $chucnangs, 'rolechucnangs' => $rolechucnangs));
     } else {
         return \Redirect::route('role.index')->with('message-error', 'Không có quyền truy cập');
     }
 }
Exemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $mymenus = Danhmucchucnang::orderBy('orders')->get();
     //dd($mymenus);
     return view('menu.index')->with(array('menus' => $this->menus, 'rolechucnangs' => $this->rolechucnangs, 'mymenus' => $mymenus));
 }