A
A
AlpineMilk2018-06-07 17:00:23
Laravel
AlpineMilk, 2018-06-07 17:00:23

Why is the user not being registered?

I use standard registration on laravel 5.5, with changing the template to my own.
in the controller RegisterControllerin the create method I wrote the following

protected function create(array $data)
    {
        $user = User::create([
            'fio' => $data['fio'],
            'email' => $data['email'],
            'type' => $data['admin'],
            'login' => $data['login'],
            'password' => bcrypt($data['password']),
            'access' => '2/1/1/1/1/1/1/1/1/1/1',
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s')
        ]);

        return $user;
    }

but when you click on the confirm button, it throws me to the same page and does not create a user in the database. As far as I understand, it does not fall into this method at all (it was registered in the dump($data) method, it did not react to it in any way), the post and action="{{ route('register')}}". What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Novikov, 2018-06-08
@AlpineMilk

The request is not validated. Override the validator method

I
Igor Timoshenkov, 2018-06-08
@t1gor

  1. Try to use Laravel Debug Bar - it immediately shows all errors, routes, queries to the database and so on. Greatly simplifies development.
  2. And why are you redefining the registration controller - add a field? It could simply be done through handling the standard registration event \Illuminate\Auth\Events\Registered. Documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question