1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Cleaned up some unessasary facade usage

This commit is contained in:
Dan Brown
2015-09-05 12:29:47 +01:00
parent eac7378ce0
commit 6b6f6d2c92
4 changed files with 12 additions and 11 deletions

View File

@ -30,16 +30,16 @@ abstract class Controller extends BaseController
public function __construct()
{
// Get a user instance for the current user
$user = Auth::user();
$user = auth()->user();
if (!$user) {
$user = User::getDefault();
}
// Share variables with views
view()->share('signedIn', Auth::check());
view()->share('signedIn', auth()->check());
view()->share('currentUser', $user);
// Share variables with controllers
$this->currentUser = $user;
$this->signedIn = Auth::check();
$this->signedIn = auth()->check();
}
/**

View File

@ -64,7 +64,7 @@ class UserController extends Controller
]);
$user = $this->user->fill($request->all());
$user->password = Hash::make($request->get('password'));
$user->password = bcrypt($request->get('password'));
$user->save();
$user->attachRoleId($request->get('role'));
@ -120,7 +120,7 @@ class UserController extends Controller
if ($request->has('password') && $request->get('password') != '') {
//dd('cat');
$password = $request->get('password');
$user->password = Hash::make($password);
$user->password = bcrypt($password);
}
$user->save();
return redirect('/users');