public function destroy($id)
    {
        $record = $this->repository->find($id);

        if ($record->delete()) {
            $message = "Successfully deleted $this->resource.";

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

            return redirect()->route($this->routes['index'])->withErrors($message);
        }
    }
public function destroy($id)
    {
        $record = $this->repository->find($id);

        if ($record->delete()) {
            $message = "Successfully deleted $this->resource.";

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

            return redirect()->route($this->routes['index'])->withErrors($message);
        }
    }
public function destroy ( $ id ) { $ record = $ this -> repository -> find ( $ id ) ; if ( $ record -> delete ( ) ) { $ message = "Successfully deleted $this->resource." ; return redirect ( ) -> route ( $ this -> routes [ 'index' ] ) -> withSuccess ( $ message ) ; } else { $ message = "There was an issue deleting this $this->resource. Please try again." ; return redirect ( ) -> route ( $ this -> routes [ 'index' ] ) -> withErrors ( $ message ) ; } }
Processes removing the specified category.

@param int|string $id

@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
Processes removing the specified category .