roles por subvendedor

This commit is contained in:
Juan Felipe Duarte
2025-06-14 11:46:14 -07:00
parent 6789ce3fb3
commit 9425f519cc
6 changed files with 146 additions and 160 deletions
+43 -24
View File
@@ -1,49 +1,68 @@
<?php
namespace App\Http\Livewire;
use App\Models\Role;
use App\Models\User;
use Livewire\Component;
use Jantinnerezo\LivewireAlert\LivewireAlert;
class ShowRoles extends Component
{
use LivewireAlert;
public $editar= false;
public $editar = false;
public $nombre;
public $add;
public $ro;
public $filtro_id;
public function render()
{
if (auth()->user()->rol_id == 5) {
$query = Role::withCount('usuarios');
if ($this->filtro_id) {
$query->where('subvendedor_id', $this->filtro_id);
}
$consulta_roles = $query->get();
$consulta_roles = Role::withCount('usuarios')->get();
//dd($consulta_roles);
return view('livewire.show-roles',['roles'=>$consulta_roles]);
$consulta_usuarios = User::orderBy('name', 'asc')->get();
} else {
$consulta_roles = Role::where('subvendedor_id', auth()->user()->id)->withCount('usuarios')->get();
$consulta_usuarios = null;
}
return view('livewire.show-roles', [
'roles' => $consulta_roles,
'usuarios' => $consulta_usuarios
]);
}
public function editar($id){
public function editar($id)
{
$this->nombre = Role::find($id)->nombre;
$this->ro = $id;
$this->editar = true;
}
public function crear(){
public function crear()
{
if (!empty($this->nombre)) {
$crear_rol = new Role;
$crear_rol->nombre = $this->nombre;
$crear_rol->save();
$crear_rol = new Role;
$crear_rol->nombre = $this->nombre;
$crear_rol->subvendedor_id = (auth()->user()->rol_id == 5) ? null : auth()->user()->id;
$crear_rol->save();
$this->alert('success', 'Rol creado correctamente!', [
'position' => 'top'
]);
$this->add = false;
}else{
$this->alert('success', 'Rol creado correctamente!', [
'position' => 'top'
]);
$this->add = false;
} else {
$this->alert('warning', 'Campo Nombre sin diligenciar!', [
'position' => 'top'
]);
}
}
public function eliminar($id)
@@ -79,29 +98,29 @@ class ShowRoles extends Component
public function confirmed()
{
$eliminar= Role::find($this->ro)->delete();
$eliminar = Role::find($this->ro)->delete();
$this->alert('success', 'Rol eliminado!', [
'position' => 'top'
]);
}
public function limpiarInputAdd(){
$this->editar= false;
public function limpiarInputAdd()
{
$this->editar = false;
$this->add = false;
}
public function actualizar(){
$eliminar= Role::find($this->ro);
public function actualizar()
{
$eliminar = Role::find($this->ro);
//dd($eliminar);
$eliminar->update(['nombre'=>$this->nombre]);
$eliminar->update(['nombre' => $this->nombre]);
$this->alert('success', 'Rol actualizado!', [
'position' => 'top'
]);
$this->editar=false;
$this->editar = false;
}
}
+16 -8
View File
@@ -14,20 +14,28 @@ class Role extends Model
'subvendedor_id',
];
public function usuarios(){
return $this ->hasMany(User::class,'rol_id');
public function subvendedor()
{
return $this->belongsTo(User::class, 'subvendedor_id');
}
public function permisos(){
return $this ->hasMany(Permiso::class,'rol_id');
public function usuarios()
{
return $this->hasMany(User::class, 'rol_id');
}
public function tarifas(){
return $this ->hasMany(Tarifas::class,'rol_id');
public function permisos()
{
return $this->hasMany(Permiso::class, 'rol_id');
}
public function rol_promos(){
return $this ->hasMany(TarifaPromo::class,'rol_id');
public function tarifas()
{
return $this->hasMany(Tarifas::class, 'rol_id');
}
public function rol_promos()
{
return $this->hasMany(TarifaPromo::class, 'rol_id');
}
}
+5
View File
@@ -38,6 +38,11 @@ class User extends Authenticatable
return $this->belongsTo(Role::class);
}
public function roles()
{
return $this->hasMany(Role::class, 'subvendedor_id');
}
public function saldo()
{
return $this->hasOne(Saldo::class, 'usuario_id');
@@ -25,76 +25,53 @@
<x-icon-arrow-right/>
Promociones
</div>
</div>
<div class=" gap-2 hidden sm:flex">
<select name="categoria_id" id="categoria_id" wire:model.debounce.500ms="categoria_id"
class="w-[8rem] border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none ring-0 focus:ring-0 focus:border-neutral-300 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
<div class="gap-2 hidden sm:flex">
<select name="categoria_id" id="categoria_id" wire:model.debounce.500ms="categoria_id" class="w-[8rem] border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none ring-0 focus:ring-0 focus:border-neutral-300 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
<option value="" selected>Categoria</option>
@foreach ($categorias as $categoria)
<option value="{{ $categoria->id }}">{{ $categoria->nombre ?? '' }}</option>
@endforeach
</select>
<div>
<button x-on:click="newCategoria=true" x-transition.duration.300ms
class="w-10 h-10 float-right bg-[#B221FD] hover:bg-[#7a02b8] rounded-full active:shadow-lg mouse shadow ease-in focus:outline-none">
<button x-on:click="newCategoria=true" x-transition.duration.300ms class="w-10 h-10 float-right bg-[#B221FD] hover:bg-[#7a02b8] rounded-full active:shadow-lg mouse shadow ease-in focus:outline-none">
<svg viewBox="0 0 20 20" enable-background="new 0 0 20 20" class="w-6 h-6 inline-block">
<path fill="#FFFFFF"
d="M16,10c0,0.553-0.048,1-0.601,1H11v4.399C11,15.951,10.553,16,10,16c-0.553,0-1-0.049-1-0.601V11H4.601
C4.049,11,4,10.553,4,10c0-0.553,0.049-1,0.601-1H9V4.601C9,4.048,9.447,4,10,4c0.553,0,1,0.048,1,0.601V9h4.399
C15.952,9,16,9.447,16,10z" />
<path fill="#FFFFFF" d="M16,10c0,0.553-0.048,1-0.601,1H11v4.399C11,15.951,10.553,16,10,16c-0.553,0-1-0.049-1-0.601V11H4.601 C4.049,11,4,10.553,4,10c0-0.553,0.049-1,0.601-1H9V4.601C9,4.048,9.447,4,10,4c0.553,0,1,0.048,1,0.601V9h4.399 C15.952,9,16,9.447,16,10z" />
</svg>
</button>
</div>
</div>
</div>
<div>
<div class="grid sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-4 gap-4 py-2 px-4">
@foreach ($promociones as $promocion)
<div class="select-none bg-white shadow-md transition hover:scale-[1.05] hover:shadow-xl cursor-pointer rounded-lg text-center relative object-cover "
x-data="{ openOption: false }">
<svg x-on:click="openOption=!openOption" xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="w-6 h-6 absolute right-2 cursor-pointer">
<path stroke-linecap="round" stroke-linejoin="round" class="text-white shadow"
d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
<div class="select-none bg-white shadow-md transition hover:scale-[1.05] hover:shadow-xl cursor-pointer rounded-lg text-center relative object-cover" x-data="{ openOption: false }">
<svg x-on:click="openOption=!openOption" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 absolute right-2 cursor-pointer">
<path stroke-linecap="round" stroke-linejoin="round" class="text-white shadow" d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
</svg>
<div wire:click="verPromocion({{$promocion->id}})" class="">
<div wire:click="verPromocion({{$promocion->id}})" class="">
<img src="{{ asset($promocion->img_publicidad) }}" alt="" class="w-full m-auto rounded-lg object-cover h-24 sm:h-44 object-center shadow">
</div>
<div x-cloak x-show="openOption"
class="absolute bg-white text-center w-[7rem] top-5 right-[-1rem] rounded-[1rem] border-b border-gray-200 shadow-lg">
<button x-on:click="openOption=!openOption,ver=true" wire:click="comprarPromo({{ $promocion->id }})"
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Comprar</button>
<div x-cloak x-show="openOption" class="absolute bg-white text-center w-[7rem] top-5 right-[-1rem] rounded-[1rem] border-b border-gray-200 shadow-lg">
<button x-on:click="openOption=!openOption,ver=true" wire:click="comprarPromo({{ $promocion->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Comprar</button>
</div>
</div>
@endforeach
</div>
</div>
</div>
{{-- Modal ver promno --}}
<div x-cloak x-show="verPromo" x-transition:enter="transition duration-350"
x-transition:enter-start="opacity-0 scale-100" x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition duration-350" x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-100"
class="absolute backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full">
<div x-cloak x-show="verPromo" x-transition:enter="transition duration-350" x-transition:enter-start="opacity-0 scale-100" x-transition:enter-end="opacity-100 scale-100" x-transition:leave="transition duration-350" x-transition:leave-start="opacity-100 scale-100" x-transition:leave-end="opacity-0 scale-100" class="absolute backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full">
<div class="grid h-full place-items-center">
<div class="bg-white rounded-lg shadow-md sm:1/2 md:1/3 lg:1/3 xl:w-1/4">
{{-- PHOTO --}}
<div class="w-full text-left text-white px-4 bg-cover py-2 rounded-lg h-64 bg-[url({{asset($this->imagen)}})] ">
</div>
<div class="text-left">
+68 -91
View File
@@ -1,40 +1,45 @@
<div x-data="{ add : @entangle('add'),
editar : @entangle('editar'),
}" class="h-full w-full md:my-2">
<div x-data="{ add: @entangle('add'), editar: @entangle('editar') }" class="h-full w-full md:my-2">
<div class=" absolute backdrop-blur-sm bg-white/70 left-0 bottom-0 top-0 right-0 h-full z-40" wire:loading wire:target="crear,actualizar,editar,eliminar,limpiarInputAdd,limpiarInputEdit">
<div class="grid h-full place-items-center ">
<div class="grid h-full place-items-center">
<div class="max-w-xs">
<img src="./img/loading.gif" alt="" class="w-full text-center" >
<img src="./img/loading.gif" alt="" class="w-full text-center">
<p class="text-gray-500 text-center">Cargando</p>
</div>
</div>
</div>
<div class="bg-[#f5f5f5] md:w-[100%] m-auto p-2 md:p-5 rounded-[1.2rem] relative mb-4 ">
<div class="bg-[#f5f5f5] md:w-[100%] m-auto p-2 md:p-5 rounded-[1.2rem] relative mb-4 ">
<div class="grid grid-cols-1 sm:flex justify-between my-2 items-center">
<div class="grid grid-cols-1 sm:flex items-center gap-3 md:gap-8">
<div class="grid grid-cols-1 sm:flex items-center gap-3 md:gap-8">
<div class="flex text-sm">
<x-icon-arrow-right/>
<x-icon-arrow-right />
Roles
</div>
<a x-on:click="add = !add"
class="justify-center flex px-4 py-2 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] mb-3 md:mb-0">Añadir
rol
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
id="Capa_1" x="0px" y="0px" viewBox="0 0 512 512"
style="enable-background:new 0 0 512 512;" xml:space="preserve" class="w-[0.87rem] ml-2">
<path
d="M480,224H288V32c0-17.673-14.327-32-32-32s-32,14.327-32,32v192H32c-17.673,0-32,14.327-32,32s14.327,32,32,32h192v192 c0,17.673,14.327,32,32,32s32-14.327,32-32V288h192c17.673,0,32-14.327,32-32S497.673,224,480,224z"
fill="#ffffff" />
</svg>
</a>
@if (auth()->user()->subvendedor)
<a x-on:click="add = !add" class="justify-center flex px-4 py-2 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] mb-3 md:mb-0">
Añadir rol
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve" class="w-[0.87rem] ml-2">
<path d="M480,224H288V32c0-17.673-14.327-32-32-32s-32,14.327-32,32v192H32c-17.673,0-32,14.327-32,32s14.327,32,32,32h192v192 c0,17.673,14.327,32,32,32s32-14.327,32-32V288h192c17.673,0,32-14.327,32-32S497.673,224,480,224z" fill="#ffffff" />
</svg>
</a>
@endif
</div>
@if (auth()->user()->rol_id == 5)
<div>
<select wire:model="filtro_id" name="filtro_user" id="filtro_user" class="w-[8rem] border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none ring-0 focus:ring-0 focus:border-neutral-300 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
<option value="" selected>Filtrar todos</option>
@foreach ($usuarios as $user)
<option value="{{ $user->id }}">{{ $user->name ?? '' }} - {{ $user->email ?? '' }}</option>
@endforeach
</select>
</div>
@endif
</div>
{{-- -Tabla usuarios - --}}
<div class=" max-h-full max-w-3xl mx-auto">
<div class="max-h-full max-w-3xl mx-auto">
<table class="w-full sm-w-[20rem] text-center mt-4 border-separate border-spacing-y-2 bg-white shadow-md rounded-lg mb-2">
<thead class="font-normal bg-[#000029] text-white h-9">
<tr class="text-left">
@@ -44,65 +49,49 @@ editar : @entangle('editar'),
</tr>
</thead>
<tbody class="text-gray-500 select-none">
@foreach ($roles as $rol)
@forelse ($roles as $rol)
<tr class="border-gray-200 text-left w-full pl-4 hover:bg-gray-200 hover:ring-gray-500" x-data="{ openOption: false }">
<td class="pl-[2rem]">{{ $rol->nombre ?? '' }}</td>
<td class="pl-[2rem]">{{ $rol->usuarios_count ?? '' }}</td>
<td class="pl-8">{{ $rol->nombre ?? '' }}</td>
<td class="pl-8">{{ $rol->usuarios_count ?? '' }}</td>
<td class="pl-2">
<button x-on:click="openOption=!openOption">
<svg xmlns="http://www.w3.org/2000/svg"
fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="w-6 h-6 cursor-pointer">
<path stroke-linecap="round" stroke-linejoin="round"
d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 cursor-pointer">
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
</svg>
</button>
<div x-cloak x-show="openOption" @click.away="openOption = false"
class="sm:absolute bg-white text-center w-[8rem] rounded-[1rem] border-b border-gray-200 shadow-lg">
<button x-on:click="openOption=false" wire:click="editar({{$rol->id}})"
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Editar</button>
<button x-on:click="openOption=false" wire:click="eliminar({{$rol->id}})"
class="text-white w-full py-1 bg-red-400 rounded-b-[1rem] hover:bg-red-600 hover:rounded-b-[1rem]">Eliminar</button>
<div x-cloak x-show="openOption" @click.away="openOption = false" class="sm:absolute bg-white text-center w-[8rem] rounded-[1rem] border-b border-gray-200 shadow-lg">
<button x-on:click="openOption=false" wire:click="editar({{ $rol->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Editar</button>
<button x-on:click="openOption=false" wire:click="eliminar({{ $rol->id }})" class="text-white w-full py-1 bg-red-400 rounded-b-[1rem] hover:bg-red-600 hover:rounded-b-[1rem]">Eliminar</button>
</div>
</td>
</tr>
@endforeach
@empty
<tr>
<td colspan="3" class="text-center py-4">
Sin datos
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
{{-- Añadir rol --}}
<div x-cloak x-show="add" x-transition:enter="transition duration-350"
x-transition:enter-start="opacity-0 scale-100" x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition duration-350" x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-100"
class="absolute backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full">
<div x-cloak x-show="add" x-transition:enter="transition duration-350" x-transition:enter-start="opacity-0 scale-100" x-transition:enter-end="opacity-100 scale-100" x-transition:leave="transition duration-350" x-transition:leave-start="opacity-100 scale-100" x-transition:leave-end="opacity-0 scale-100" class="absolute backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full">
<div class="grid h-full place-items-center ">
<form>
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md">
<div class="mb-4">
<label for="nombre"
class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label>
<input type="text" id="nombre" wire:model="nombre"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
<label for="nombre" class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label>
<input type="text" id="nombre" wire:model="nombre" class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
<div
class="bg-white px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse sm:justify-evenly gap-5 mt-4">
<div class="bg-white px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse sm:justify-evenly gap-5 mt-4">
<span>
<button wire:click="crear" type="button"
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Guardar</button>
<button wire:click="crear" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Guardar</button>
</span>
<span>
<button wire:click="limpiarInputAdd" type="button"
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#585858] hover:bg-[#3a3a3a] ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
<button wire:click="limpiarInputAdd" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#585858] hover:bg-[#3a3a3a] ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
</span>
</div>
</div>
@@ -110,39 +99,27 @@ editar : @entangle('editar'),
</div>
</div>
{{-- editar rol --}}
<div x-cloak x-show="editar" x-transition:enter="transition duration-350"
x-transition:enter-start="opacity-0 scale-100" x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition duration-350" x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-100"
class="absolute backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full">
<div class="grid h-full place-items-center ">
<form>
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md">
<div class="mb-4">
<label for="nombre_edit"
class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label>
<input type="text" id="nombre_edit" wire:model="nombre"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
<div
class="bg-white px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse sm:justify-evenly gap-5 mt-4">
<span>
<button wire:click="actualizar" type="button"
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Guardar</button>
</span>
<span>
<button wire:click="limpiarInputAdd" type="button"
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#585858] hover:bg-[#3a3a3a] ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
</span>
</div>
</div>
</form>
</div>
</div>
{{-- editar rol --}}
<div x-cloak x-show="editar" x-transition:enter="transition duration-350" x-transition:enter-start="opacity-0 scale-100" x-transition:enter-end="opacity-100 scale-100" x-transition:leave="transition duration-350" x-transition:leave-start="opacity-100 scale-100" x-transition:leave-end="opacity-0 scale-100" class="absolute backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full">
<div class="grid h-full place-items-center ">
<form>
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md">
<div class="mb-4">
<label for="nombre_edit" class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label>
<input type="text" id="nombre_edit" wire:model="nombre" class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
<div class="bg-white px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse sm:justify-evenly gap-5 mt-4">
<span>
<button wire:click="actualizar" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Guardar</button>
</span>
<span>
<button wire:click="limpiarInputAdd" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#585858] hover:bg-[#3a3a3a] ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
</span>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
+2 -2
View File
@@ -42,11 +42,12 @@ Route::middleware(["auth"])->group(function () {
Route::get('/wompi/{monto}', [MenuController::class, 'showwompi'])->name('wompi');
Route::any('/logs', [MenuController::class, 'showlogs'])->name('logs');
Route::any('/usuarios', [MenuController::class, 'showusuarios'])->name('usuarios');
Route::any('/roles', [MenuController::class, 'showroles'])->name('roles');
});
// Editores
Route::middleware(["auth", "solo_usuario_editor"])->group(function () {
Route::any('/planes', [MenuController::class, 'showplanes'])->name('planes');
Route::any('/planes', [MenuController::class, 'showplanes'])->name('planes');
Route::get('/import', [MenuController::class, 'showimport'])->name('import');
});
@@ -61,7 +62,6 @@ Route::middleware(["auth", "solo_usuario_administrador"])->group(function () {
Route::any('/logs-recargas', [MenuController::class, 'showLogRecargas'])->name('logsRecargas');
Route::any('/log-general', [MenuController::class, 'showLogGeneral'])->name('logGeneral');
Route::any('/log-historial', [MenuController::class, 'showLogHistorial'])->name('logHistorial');
Route::any('/roles', [MenuController::class, 'showroles'])->name('roles');
Route::get('/utilidades', [MenuController::class, 'showutilidad'])->name('utilidades');
Route::get('/mantenimiento', [MenuController::class, 'mantenimiento'])->name('mantenimiento');
});