/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(IngresosRequest $request) { if ($request->ajax()) { Ingresos::create(['tipo_ingresos_id' => $request['ingorigen'], 'monto' => $request['ingmonto'], 'fecha' => Carbon::now()]); return response()->json("exitoso"); } else { $error = $request->errors()->all(); return response()->json($error); } }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $ingresosR = Ingresos::all(); return view('reportes/ingresos', compact('ingresosR')); }