I am a bit stuck.. I am new to laravel so please excuse my lack of knowledge. In my application I have 3 types of users. Admin, Instructor & Student. To begin with I created three users for these roles in my UsersTableSeeder and hashed their passwords.
As I develop my system I have created a 'create users form' that admins only have access to. However when I try to sign in with users created via this form apparently their "credentials do not exist". I am assuming this could be related to the fact that their passwords are not storing as hashed in the DB? I understand this is bad practice but I am not aware how to pass a hashed password in a view/controller. Any advice is appreciated.
create.blade.php;
<div class="form-group">
<label class="required" for="password">Password</label>
<input class="form-control {{ $errors->has('password') ? 'is-invalid' : '' }}" type="password" name="password" id="password" required>
@if($errors->has('password'))
<div class="invalid-feedback">
{{ $errors->first('password') }}
</div>
@endif
</div>
UsersController;
public function create()
{
$roles = Role::all();
$courses =Course::all();
return view('admin.user.create', compact('roles', 'courses'));
}
I hope my image below helps you understand. The users with hashed passwords where either created via the register form or UsersTableSeeder however I need to be able to successfully create a user via the create form.
Hash::make('your password text');
like how you did for other users. – nice_dev