public function destroy($resourceId, $eventId)
    {
        $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);

        if (method_exists($eventable, 'events')) {
            $event = $eventable->events()->find($eventId);

            if ($event && $this->event->delete($event->id)) {
                $message = 'Successfully deleted event.';

                return redirect()->route($this->routes['index'], $eventable->id)->withSuccess($message);
            } else {
                $message = 'There was an issue deleting this event. Please try again.';

                return redirect()->route($this->routes['show'], $eventable->id, $event->id)->withErrors($message);
            }
        }

        abort(404);
    }
public function destroy($resourceId, $eventId)
    {
        $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);

        if (method_exists($eventable, 'events')) {
            $event = $eventable->events()->find($eventId);

            if ($event && $this->event->delete($event->id)) {
                $message = 'Successfully deleted event.';

                return redirect()->route($this->routes['index'], $eventable->id)->withSuccess($message);
            } else {
                $message = 'There was an issue deleting this event. Please try again.';

                return redirect()->route($this->routes['show'], $eventable->id, $event->id)->withErrors($message);
            }
        }

        abort(404);
    }
public function destroy ( $ resourceId , $ eventId ) { $ eventable = $ this -> getEventableRepository ( ) -> model ( ) -> findOrFail ( $ resourceId ) ; if ( method_exists ( $ eventable , 'events' ) ) { $ event = $ eventable -> events ( ) -> find ( $ eventId ) ; if ( $ event && $ this -> event -> delete ( $ event -> id ) ) { $ message = 'Successfully deleted event.' ; return redirect ( ) -> route ( $ this -> routes [ 'index' ] , $ eventable -> id ) -> withSuccess ( $ message ) ; } else { $ message = 'There was an issue deleting this event. Please try again.' ; return redirect ( ) -> route ( $ this -> routes [ 'show' ] , $ eventable -> id , $ event -> id ) -> withErrors ( $ message ) ; } } abort ( 404 ) ; }
Deletes the specified event attached to the specified eventable.

@param int|string $resourceId
@param int|string $eventId

@return \Illuminate\Http\RedirectResponse
Deletes the specified event attached to the specified eventable .