App\Modules\Users\Controllers\Admin\Users::destroy PHP Method

destroy() public method

public destroy ( $id )
    public function destroy($id)
    {
        // Get the User Model instance.
        $user = User::find($id);
        if ($user === null) {
            // There is no User with this ID.
            $status = __d('users', 'User not found: #{0}', $id);
            return Redirect::to('admin/users')->withStatus($status, 'danger');
        }
        // Destroy the requested User record.
        $user->delete();
        // Prepare the flash message.
        $status = __d('users', 'The User <b>{0}</b> was successfully deleted.', $user->username);
        return Redirect::to('admin/users')->withStatus($status);
    }