src/Http/Controllers/EntranceController.php
public function doRegister(RegisterRequest $request)
    {
        // Encrypt the password
        $request['password'] = bcrypt($request->password);

        $userModel = config('entrance.classes.user_model');
        $user = $userModel::create($request->all());

        if(config('intothesource')) {
            $roleModel = config('intothesource.usermanager.default_role_model');
            $role = $roleModel::where('name', config('intothesource.usermanager.default_role'))->firstOrFail()->id;
            $user->roles()->attach([$role]);
        }

        $request->session()->flash('message', 'Succesvol geregistreerd');
        return Redirect()->route('register');
    }
public function doRegister(RegisterRequest $request)
    {
        // Encrypt the password
        $request['password'] = bcrypt($request->password);

        $userModel = config('entrance.classes.user_model');
        $user = $userModel::create($request->all());

        if(config('intothesource')) {
            $roleModel = config('intothesource.usermanager.default_role_model');
            $role = $roleModel::where('name', config('intothesource.usermanager.default_role'))->firstOrFail()->id;
            $user->roles()->attach([$role]);
        }

        $request->session()->flash('message', 'Succesvol geregistreerd');
        return Redirect()->route('register');
    }
public function doRegister ( RegisterRequest $ request ) { // Encrypt the password $ request [ 'password' ] = bcrypt ( $ request -> password ) ; $ userModel = config ( 'entrance.classes.user_model' ) ; $ user = $ userModel :: create ( $ request -> all ( ) ) ; if ( config ( 'intothesource' ) ) { $ roleModel = config ( 'intothesource.usermanager.default_role_model' ) ; $ role = $ roleModel :: where ( 'name' , config ( 'intothesource.usermanager.default_role' ) ) -> firstOrFail ( ) -> id ; $ user -> roles ( ) -> attach ( [ $ role ] ) ; } $ request -> session ( ) -> flash ( 'message' , 'Succesvol geregistreerd' ) ; return Redirect ( ) -> route ( 'register' ) ; }
Register the given input

@param RegisterRequest $request
@return redirect
Register the given input