Example #1
0
 public function __construct()
 {
     $info_user = User::find(Auth::id());
     $list_language = AppLanguage::all();
     View::share('list_language', $list_language);
     View::share('info_user', $info_user);
 }
Example #2
0
 /**
  * Upload images.
  *
  * @parram Images
  * @return Image name
  */
 public function changePassword($request, $user_id)
 {
     $new_password = bcrypt($request->input('password'));
     $user = User::find($user_id);
     $user->password = $new_password;
     $user->save();
     return $user_id;
 }
Example #3
0
 /**
  * Construct
  */
 public function __construct()
 {
     $info_user = User::find(Auth::id());
     $list_language = AppLanguage::all();
     $setting_title = Configuration::first();
     if ($setting_title) {
         $setting_title = unserialize($setting_title->properties)['title'];
     }
     View::share('list_language', $list_language);
     View::share('info_user', $info_user);
     View::share('title_all', $setting_title);
 }
Example #4
0
 /**
  * Update the specified resource in storage.
  *
  * @param \Illuminate\Http\Request $request Request
  *
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request)
 {
     $role = new Role();
     $user = new User();
     $user_id = $request->route('user');
     $info_user = $user->find($user_id);
     // $info = $info_user->roles()->get();
     if ($info_user) {
         $array_role = array();
         foreach ($info_user->roles as $role) {
             $array_role[] = $role->pivot->role_id;
         }
         $list_role = $role->selectBoxRole($array_role);
         return view('admin.user.updateuser', compact('list_role', 'info_user'));
     } else {
         return redirect()->route('cpanel.user.index')->with('status', 'fail')->with('msg', 'User not available.');
     }
 }
Example #5
0
 public function __construct()
 {
     $info_user = User::find(Auth::id());
     view()->share('info_user', $info_user);
     view()->share('type', 'languages');
 }