I'm slowing catching up with laravel but problem is, trying to register a new user into my new laravel application. the user role is not shown on the user page (index.blade.php) and I can't sign into the application using the username and password that is saved. The other problem i am facing is, the Role assigned to a user is not displayed either. What could be the problem and how do i encrypt the entered user password?
this is the store function
public function store(Request $request)
{
//validate data
$validation=$this->validate($request, [
'username' => 'required|max:50',
'role_id' => 'required|numeric',
'email' => 'required|email|max:50'
]);
$user = new User;
$user->username = $request->username;
$user->role_id = $request->role_id;
$user->email = $request->email;
$user->save();
// redirect
Session::flash('message', 'Successfully added new user!');
Session::flash('alert-type', 'success');
return Redirect::to('user');
}