public function store(MeterRequest $request, $id)
    {
        $meter = $this->meter->create($request, $id);

        if ($meter) {
            $message = 'Successfully created meter.';

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

            return redirect()->route('maintenance.assets.meters.create', [$id])->withErrors($message);
        }
    }
public function store(MeterRequest $request, $id)
    {
        $meter = $this->meter->create($request, $id);

        if ($meter) {
            $message = 'Successfully created meter.';

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

            return redirect()->route('maintenance.assets.meters.create', [$id])->withErrors($message);
        }
    }
public function store ( MeterRequest $ request , $ id ) { $ meter = $ this -> meter -> create ( $ request , $ id ) ; if ( $ meter ) { $ message = 'Successfully created meter.' ; return redirect ( ) -> route ( 'maintenance.assets.meters.index' , [ $ id ] ) -> withSuccess ( $ message ) ; } else { $ message = 'There was an issue creating a meter. Please try again.' ; return redirect ( ) -> route ( 'maintenance.assets.meters.create' , [ $ id ] ) -> withErrors ( $ message ) ; } }
Creates a new meter for the specified asset.

@param MeterRequest $request
@param int|string   $id

@return \Illuminate\Http\RedirectResponse
Creates a new meter for the specified asset .