src/Http/Controllers/Admin/UsersController.php
public function store(CreateUserRequest $request, User $user)
    {
        $this->authorize(UsersPolicy::PERMISSION_CREATE);

        $user->fill($request->getValidatedData());
        $user->is_active = true;
        $user->save();
        $user->roles()->sync($request->get('roles'));

        $this->transNotification('created', ['name' => $user->full_name], $user->toArray());

        return redirect()->route('admin::auth.users.index');
    }
public function store(CreateUserRequest $request, User $user)
    {
        $this->authorize(UsersPolicy::PERMISSION_CREATE);

        $user->fill($request->getValidatedData());
        $user->is_active = true;
        $user->save();
        $user->roles()->sync($request->get('roles'));

        $this->transNotification('created', ['name' => $user->full_name], $user->toArray());

        return redirect()->route('admin::auth.users.index');
    }
public function store ( CreateUserRequest $ request , User $ user ) { $ this -> authorize ( UsersPolicy :: PERMISSION_CREATE ) ; $ user -> fill ( $ request -> getValidatedData ( ) ) ; $ user -> is_active = true ; $ user -> save ( ) ; $ user -> roles ( ) -> sync ( $ request -> get ( 'roles' ) ) ; $ this -> transNotification ( 'created' , [ 'name' => $ user -> full_name ] , $ user -> toArray ( ) ) ; return redirect ( ) -> route ( 'admin::auth.users.index' ) ; }
Store the new user.

@param  \Arcanesoft\Auth\Http\Requests\Admin\Users\CreateUserRequest  $request
@param  \Arcanesoft\Contracts\Auth\Models\User                        $user

@return \Illuminate\Http\RedirectResponse
Store the new user .