public function update(Request $request, $id)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate(['name' => 'required|max:128']);
        /** @noinspection PhpUndefinedMethodInspection */
        $location = Location::findOrFail($id);
        $location->name = $request->name;
        $this->authorize('update', $location);
        /** @noinspection PhpUndefinedMethodInspection */
        $location->save();
        return fractal($location, new LocationTransformer())
            ->withResourceName('location')
            ->respond();

    }
public function update(Request $request, $id)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate(['name' => 'required|max:128']);
        /** @noinspection PhpUndefinedMethodInspection */
        $location = Location::findOrFail($id);
        $location->name = $request->name;
        $this->authorize('update', $location);
        /** @noinspection PhpUndefinedMethodInspection */
        $location->save();
        return fractal($location, new LocationTransformer())
            ->withResourceName('location')
            ->respond();

    }
public function update ( Request $ request , $ id ) { /** @noinspection PhpUndefinedMethodInspection */ $ request -> validate ( [ 'name' => 'required|max:128' ] ) ; /** @noinspection PhpUndefinedMethodInspection */ $ location = Location :: findOrFail ( $ id ) ; $ location -> name = $ request -> name ; $ this -> authorize ( 'update' , $ location ) ; /** @noinspection PhpUndefinedMethodInspection */ $ location -> save ( ) ; return fractal ( $ location , new LocationTransformer ( ) ) -> withResourceName ( 'location' ) -> respond ( ) ; }
Store an updated Location
@param  \Illuminate\Http\Request $request current Request object
@param string $id UUID of Location to update
@return \Illuminate\Http\Response JSON object of updated Location
Store an updated Location