我正在使用 laravel livewire 删除两个表中的记录,问题是模式,记录正在被删除,但模式仍然显示。
\n奇怪的是,当我注释其中一行代码来删除数据时,它起作用了!
\n我正在使用 Bootstrap 4.1
\n这是我的功能:
\n public function delete($id)\n {\n DB::beginTransaction();\n try \n { \n // If I comment on any of the following two lines (it doesn't matter what line it is), it works! \n\n DetalleRamComputadora::where('fk_computadora', '=', $id)->delete();\n Computadora::where('id', '=', $id)->delete();\n\n DB::commit();\n $this->emit('confirm'); // Close modal "confirm"\n session()->flash('success', 'Registro eliminado con \xc3\xa9xito');\n\n } catch (\\Throwable $th) {\n DB::rollBack();\n $this->emit('confirm'); // Close modal "confirm"\n session()->flash('error', 'Ocurri\xc3\xb3 un error y no se almacen\xc3\xb3 el …Run Code Online (Sandbox Code Playgroud) laravel eloquent bootstrap-modal bootstrap-4 laravel-livewire