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

        $meter = $asset->meters()->findOrFail($meterId);

        if ($meter->delete()) {
            $message = 'Successfully deleted meter.';

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

            return redirect()->route('maintenance.assets.meters.show', [$id, $meterId])->withErrors($message);
        }
    }
public function destroy($id, $meterId)
    {
        $asset = $this->asset->model()->findOrFail($id);

        $meter = $asset->meters()->findOrFail($meterId);

        if ($meter->delete()) {
            $message = 'Successfully deleted meter.';

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

            return redirect()->route('maintenance.assets.meters.show', [$id, $meterId])->withErrors($message);
        }
    }
public function destroy ( $ id , $ meterId ) { $ asset = $ this -> asset -> model ( ) -> findOrFail ( $ id ) ; $ meter = $ asset -> meters ( ) -> findOrFail ( $ meterId ) ; if ( $ meter -> delete ( ) ) { $ message = 'Successfully deleted meter.' ; return redirect ( ) -> route ( 'maintenance.assets.meters.index' , [ $ id ] ) -> withSuccess ( $ message ) ; } else { $ message = 'There was an issue deleting this meter. Please try again.' ; return redirect ( ) -> route ( 'maintenance.assets.meters.show' , [ $ id , $ meterId ] ) -> withErrors ( $ message ) ; } }
Deletes the specified meter for the specified asset.

@param int|string $id
@param int|string $meterId

@return \Illuminate\Http\RedirectResponse
Deletes the specified meter for the specified asset .