public function destroy(GalleryRequest $request, Gallery $gallery)
    {
        try {

            $gallery->delete();
            return $this->response->message(trans('messages.success.deleted', ['Module' => trans('gallery::gallery.name')]))
                ->code(202)
                ->status('success')
                ->url(guard_url('gallery/gallery/0'))
                ->redirect();

        } catch (Exception $e) {

            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('gallery/gallery/' . $gallery->getRouteKey()))
                ->redirect();
        }

    }
public function destroy(GalleryRequest $request, Gallery $gallery)
    {
        try {

            $gallery->delete();
            return $this->response->message(trans('messages.success.deleted', ['Module' => trans('gallery::gallery.name')]))
                ->code(202)
                ->status('success')
                ->url(guard_url('gallery/gallery/0'))
                ->redirect();

        } catch (Exception $e) {

            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('gallery/gallery/' . $gallery->getRouteKey()))
                ->redirect();
        }

    }
public function destroy ( GalleryRequest $ request , Gallery $ gallery ) { try { $ gallery -> delete ( ) ; return $ this -> response -> message ( trans ( 'messages.success.deleted' , [ 'Module' => trans ( 'gallery::gallery.name' ) ] ) ) -> code ( 202 ) -> status ( 'success' ) -> url ( guard_url ( 'gallery/gallery/0' ) ) -> redirect ( ) ; } catch ( Exception $ e ) { return $ this -> response -> message ( $ e -> getMessage ( ) ) -> code ( 400 ) -> status ( 'error' ) -> url ( guard_url ( 'gallery/gallery/' . $ gallery -> getRouteKey ( ) ) ) -> redirect ( ) ; } }
Remove the gallery.

@param Model   $gallery

@return Response
Remove the gallery .