app/Http/Controllers/API/CategoriasController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $request->validate(Categoria::reglasValidacion());
        $categoria = Categoria::create($request->all());
        return new CategoriaResource($categoria);
    }
public function store ( Request $ request ) { $ request -> validate ( Categoria :: reglasValidacion ( ) ) ; $ categoria = Categoria :: create ( $ request -> all ( ) ) ; return new CategoriaResource ( $ categoria ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .