コード例 #1
0
 public function postBorrar(Request $request)
 {
     $id = $request->id;
     $carga = Cargas::find($id);
     $carga->delete();
     return response()->json('yes', 200);
 }
コード例 #2
0
 public function postFecha(Request $request)
 {
     $mes = $request->mes;
     $anio = $request->anio;
     $id = Auth::user()->id;
     $carga = Cargas::where('user_id', '=', $id)->where('procesado', '=', false)->first();
     if ($carga->sat()->count() > 0 || $carga->empresa()->count() > 0) {
         return response()->json(['mes' => $carga->mes, 'anio' => $carga->anio], 200);
     }
     if ($mes || $mes == 0) {
         $carga->mes = $mes;
     }
     if ($anio) {
         $carga->anio = $anio;
     }
     $carga->save();
     return response()->json(['mes' => $carga->mes, 'anio' => $carga->anio], 200);
 }