hello i want to add user when admin log in. i use default Register form.
it success but remember_token is missing and parssword not decrypt.
this is my controller :
public function create()
{
return view('admin/dosen.create');
}
public function store(CreateDosenRequest $request)
{
User::create($request->all());
return redirect('admin/dosen')->with('message', 'Data berhasil ditambahkan!');
}
and my request :
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required|max:255',
'username'=>'required|unique:users',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|confirmed|min:6',
];
}
Route :
Route::resource('/admin/dosen', 'AdminController',
['except => show, index']);
});
<form method="post" action="#"><input type="hidden" name="_token" value="{{csrf_token()}}"></form>
Just add this in html form.Working :)