1

If my $request->get('users') returns:

Array
(
    [password] => 14032001
    [password_confirmation] => 14032001
)

how can I access the password field?

2 Answers 2

2

Does $request->get('users')['password'] work?

Sign up to request clarification or add additional context in comments.

2 Comments

Dumb me, thanks seems logic. But how can I replace a value? $request->replace(array('password', sha1($request->get('users')['password'])));
I never did this manually, but maybe you want something like this: $request->replace(['password' => Hash::make($request->get('users')['password'])]);
0

You can do something like this:

$data = new \App\Model($request->all());

And then access the fields like:

$data['password']

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.