Ejemplo n.º 1
0
 public function addServico()
 {
     if (request()->ajax()) {
         try {
             Contrato::vincularServico(request());
             $contrato = Contrato::find(request()->get('contrato'));
             $html = view('admin.contrato.includes.servicos')->with('contrato', $contrato)->render();
             return response()->json(['html' => $html]);
         } catch (\Exception $e) {
             return response()->json(['error' => $e->getMessage()]);
         }
     } else {
         return "Acesso negado";
     }
 }