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

destroy() public method

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