porfavor hacer la migracion
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Models\Cuentas;
|
||||
use App\Models\Historiale;
|
||||
use App\Models\Historial_cuenta;
|
||||
use App\Models\Log_general;
|
||||
use App\Models\Log_historial;
|
||||
use App\Models\Notificacion;
|
||||
use App\Models\Pendientes;
|
||||
use App\Models\Role;
|
||||
@@ -280,6 +281,11 @@ class ShowPlanes extends Component
|
||||
$cuenta->estado = $this->estado;
|
||||
$cuenta->save();
|
||||
|
||||
Log_historial::create([
|
||||
'user_id' => Auth::user()->id,
|
||||
'detalle' => 'El usuario ha creado la cuenta ' . $cuenta->correo
|
||||
]);
|
||||
|
||||
if ($this->estado === 'activo') {
|
||||
$servicioPantallas = Servicio::find($this->servicio_newCuenta)->pantallas;
|
||||
|
||||
@@ -487,8 +493,24 @@ class ShowPlanes extends Component
|
||||
|
||||
public function eliminarCuentas()
|
||||
{
|
||||
$cuentas = Cuentas::whereIn('id', $this->delete_1)->get();
|
||||
|
||||
if ($cuentas) {
|
||||
forEach ($cuentas as $cuenta) {
|
||||
Log_historial::create([
|
||||
'user_id' => Auth::user()->id,
|
||||
'detalle' => 'El usuario ha eliminado la cuenta ' . $cuenta->correo
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$consulta_cuentas = Cuentas::whereIn('id', $this->delete_1)->delete();
|
||||
|
||||
$this->alert('success', 'Cuentas eliminadas correctamente!', [
|
||||
'position' => 'top'
|
||||
]);
|
||||
|
||||
$this->delete_1 = [];
|
||||
}
|
||||
|
||||
public function openAdd()
|
||||
|
||||
Reference in New Issue
Block a user