public function destroy($listener, $id)
    {
        $role = $this->model->findOrFail($id);

        try {
            DB::transaction(function () use ($role) {
                $role->delete();
            });
        } catch (Exception $e) {
            return $listener->destroyFailed(['error' => $e->getMessage()]);
        }

        return $listener->destroySucceed($role);
    }
public function destroy($listener, $id)
    {
        $role = $this->model->findOrFail($id);

        try {
            DB::transaction(function () use ($role) {
                $role->delete();
            });
        } catch (Exception $e) {
            return $listener->destroyFailed(['error' => $e->getMessage()]);
        }

        return $listener->destroySucceed($role);
    }
public function destroy ( $ listener , $ id ) { $ role = $ this -> model -> findOrFail ( $ id ) ; try { DB :: transaction ( function ( ) use ( $ role ) { $ role -> delete ( ) ; } ) ; } catch ( Exception $ e ) { return $ listener -> destroyFailed ( [ 'error' => $ e -> getMessage ( ) ] ) ; } return $ listener -> destroySucceed ( $ role ) ; }
Delete a role.

@param  object  $listener
@param  string|int  $id

@return mixed
Delete a role .