app/Http/Controllers/InsumoController.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)
  {
    $insumo = new Insumo($request->all());
    if ($insumo->save()) {
      return response()->json($this->messages['create.success'], Response::HTTP_OK);
    }
    return response()->json($this->messages['create.fail'], Response::HTTP_CONFLICT);
  }
public function store ( Request $ request ) { $ insumo = new Insumo ( $ request -> all ( ) ) ; if ( $ insumo -> save ( ) ) { return response ( ) -> json ( $ this -> messages [ 'create.success' ] , Response :: HTTP_OK ) ; } return response ( ) -> json ( $ this -> messages [ 'create.fail' ] , Response :: HTTP_CONFLICT ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .