/**
  * Bootstrap any application services.
  *
  */
 public function boot()
 {
     view()->composer('*', function ($view) {
         if (Auth::check()) {
             $permission = \Permission_Check::getPermission();
             $view->with('permission', $permission);
         }
     });
     //        View::share('permission1', \Auth::user());
 }
 public function RoleEditView($id)
 {
     if (!is_null($id)) {
         if (Auth::check()) {
             if (User::isSuperAdmin()) {
                 $role_obj = Role::find($id);
                 return view('user.edit_role')->with('role_obj', $role_obj)->with('permission', \Permission_Check::getPermission());
             }
             return \Redirect::back()->withErrors(['success' => false, 'msg' => 'You don\'t have permission']);
         }
         return Redirect::to(url('user/login'));
     }
     return \Redirect::back()->withErrors(['success' => false, 'msg' => 'somethings went wrongs']);
 }