app/Http/Controllers/Auth/RegisterController.php
/**
     * Create a new user instance after a valid registration.
     *
     * @return \App\User
     */
Create a new user instance after a valid registration.
@return \App\User
Create a new user instance after a valid registration . @return \ App \ User
protected function create(array $data)
    {
        return User::create([
            'name'      => $data['name'],
            'email'     => $data['email'],
            'number'    => $data['number'],
            'idtype'    => $data['idtype'],
            'noid'      => $data['noid'],
            'alamat'    => $data['alamat'],
            'dob'       => $data['dob'],
            'jk'        => $data['jk'],
            'password' => Hash::make($data['password']),
        ]);
        $role = Role::select('id')->where('name', 'user')->first();
        $user->roles()->attch($role);
        return $user;
    }
protected function create ( array $ data ) { return User :: create ( [ 'name' => $ data [ 'name' ] , 'email' => $ data [ 'email' ] , 'number' => $ data [ 'number' ] , 'idtype' => $ data [ 'idtype' ] , 'noid' => $ data [ 'noid' ] , 'alamat' => $ data [ 'alamat' ] , 'dob' => $ data [ 'dob' ] , 'jk' => $ data [ 'jk' ] , 'password' => Hash :: make ( $ data [ 'password' ] ) , ] ) ; $ role = Role :: select ( 'id' ) -> where ( 'name' , 'user' ) -> first ( ) ; $ user -> roles ( ) -> attch ( $ role ) ; return $ user ; }
Create a new user instance after a valid registration.
Create a new user instance after a valid registration .