コード例 #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     if ($request->ajax()) {
         Egresos::create($request->all());
         return response()->json(["message" => "creado"]);
     }
 }
コード例 #2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(EgresosCreateRequest $request)
 {
     if ($request->ajax()) {
         $id_site = \Session::get('id_site');
         $newEg = Egresos::create($request->all());
         $egreso = Egresos::find($newEg->id);
         $egreso->id_site = $id_site;
         $egreso->save();
         return response()->json(["message" => "creado"]);
     }
 }