app/Http/Controllers/API/CategoriasController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
        $request->validate(Categoria::reglasValidacion());
        $categoria = Categoria::findOrFail($id);
        $categoria->update($request->all());
        return new CategoriaResource($categoria);
    }
public function update ( Request $ request , $ id ) { $ request -> validate ( Categoria :: reglasValidacion ( ) ) ; $ categoria = Categoria :: findOrFail ( $ id ) ; $ categoria -> update ( $ request -> all ( ) ) ; return new CategoriaResource ( $ categoria ) ; }
Update the specified resource in storage.
Update the specified resource in storage .