logs editor
This commit is contained in:
@@ -16,14 +16,11 @@ class SoloUsuarioAdministrador
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
{
|
||||
if (Auth::user()->rol->nombre =="administrador" || Auth::user()->rol->nombre == "super" || Auth::user()->rol->nombre == "editor") {
|
||||
return $next($request);
|
||||
|
||||
} else {
|
||||
|
||||
return redirect()->back()->with("mensaje", "No puedes acceder al módulo seleccionado");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{{-- menu lateral --}}
|
||||
<div class="sm:block h-full"
|
||||
x-data="{ menuG:false}"
|
||||
|
||||
|
||||
>
|
||||
<div x-cloak x-show="menuG" class="bg-[radial-gradient(ellipse_at_bottom,_var(--tw-gradient-stops))] from-[{{App\Models\Configuracione::Orderby('id','desc')->first()->color_menu}}] via-[{{App\Models\Configuracione::Orderby('id','desc')->first()->color_menu}}] to-white w-[280px] drop-shadow-2xl rounded-xl fixed h-full"
|
||||
x-show="open"
|
||||
@@ -41,8 +41,8 @@ x-data="{ menuG:false}"
|
||||
<div class="font-semibold text-sm text-gray-500 capitalize">{{ Auth::user()->rol->nombre }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="bg-white mx-5 m-auto rounded-xl shadow-lg mb-5">
|
||||
<div class="space-y-1 border-b border-gray-100">
|
||||
<x-responsive-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
|
||||
@@ -92,8 +92,8 @@ x-data="{ menuG:false}"
|
||||
@endif
|
||||
</div>
|
||||
@if (auth()->user()->rol->nombre == "super" || auth()->user()->rol->nombre == "administrador" || auth()->user()->rol->nombre == "editor")
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="relative shadow-md block w-11/12 mx-auto select-none " x-data="{selected:null}">
|
||||
<li class="flex align-center flex-col">
|
||||
<h4 @click="selected !== 0 ? selected = 0 : selected = null"
|
||||
@@ -114,25 +114,29 @@ x-data="{ menuG:false}"
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('utilidades') }}">Utilidades</a>
|
||||
<a class="block cursor-pointer hover:rounded-b-md rounded-b-md text-center hover:bg-[#d1d3e1] w-full px-3 py-1" href="{{ route('configuracion') }}">Configuración</a>
|
||||
@endif
|
||||
@if (auth()->user()->rol->nombre == "editor")
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('logGeneral') }}">Log general</a>
|
||||
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('logs') }}">Logs cuentas</a>
|
||||
@endif
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="space-y-1 bg-[#FF5050] mx-4 m-auto rounded-xl mt-2 sm:mt-5 ">
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
|
||||
|
||||
<a class="cursor-pointer text-white flex pl-3 pr-4 py-3 text-base font-medium transition duration-150 ease-in-out justify-between" :href="route('logout')"
|
||||
onclick="event.preventDefault();
|
||||
this.closest('form').submit();">
|
||||
<h3 class="mx-4">
|
||||
{{ __('Cerrar Sesión') }}
|
||||
</h3>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" class="w-5 mx-3" x="0" y="0" viewBox="0 0 447.674 447.674" style="enable-background:new 0 0 512 512" xml:space="preserve" class="">
|
||||
<path d="M182.725,379.151c-0.572-1.522-0.769-2.816-0.575-3.863c0.193-1.04-0.472-1.902-1.997-2.566
|
||||
c-1.525-0.664-2.286-1.191-2.286-1.567c0-0.38-1.093-0.667-3.284-0.855c-2.19-0.191-3.283-0.288-3.283-0.288h-3.71h-3.14H82.224
|
||||
@@ -154,16 +158,16 @@ x-data="{ menuG:false}"
|
||||
</a>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="absolute top-4 right-2">
|
||||
<svg x-on:click="menuG=false,menuP=true" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" version="1.1" class="w-5 cursor-pointer" x="0" y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512" xml:space="preserve">
|
||||
<path d="M17.921,1.505a1.5,1.5,0,0,1-.44,1.06L9.809,10.237a2.5,2.5,0,0,0,0,3.536l7.662,7.662a1.5,1.5,0,0,1-2.121,2.121L7.688,15.9a5.506,5.506,0,0,1,0-7.779L15.36.444a1.5,1.5,0,0,1,2.561,1.061Z" fill="#b221fd" data-original="#000000"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div x-cloak
|
||||
|
||||
</div>
|
||||
|
||||
<div x-cloak
|
||||
|
||||
|
||||
x-show="!menuG" class="bg-[#f2f4ff] h-full shadow-lg rounded-xl ">
|
||||
<div class=" m-auto rounded-2xl py-6">
|
||||
@@ -180,7 +184,7 @@ x-data="{ menuG:false}"
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="bg-[#b221fd] m-auto mb-4 hover:bg-[#7a02b8]">
|
||||
<div class="space-y-1">
|
||||
<x-responsive-nav-link :href="route('perfil')">
|
||||
@@ -206,8 +210,8 @@ x-data="{ menuG:false}"
|
||||
</x-responsive-nav-link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="bg-white m-auto shadow-lg">
|
||||
<div class="space-y-1 border-b border-gray-100">
|
||||
<x-responsive-nav-link class="rounded-none" :href="route('dashboard')" :active="request()->routeIs('dashboard')">
|
||||
@@ -249,11 +253,11 @@ x-data="{ menuG:false}"
|
||||
</x-responsive-nav-link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="space-y-1 bg-[#FF5050] hover:bg-[#ff3131] m-auto mt-8 mb-4">
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
|
||||
|
||||
<a class="cursor-pointer text-white flex pl-3 pr-4 py-3 text-base font-medium transition duration-150 ease-in-out justify-between " :href="route('logout')"
|
||||
onclick="event.preventDefault();
|
||||
this.closest('form').submit();">
|
||||
@@ -278,8 +282,8 @@ x-data="{ menuG:false}"
|
||||
</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -323,8 +327,8 @@ x-data="{ menuG:false}"
|
||||
<div class="font-semibold text-sm text-gray-500 capitalize">{{ Auth::user()->rol->nombre }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="bg-white mx-5 m-auto rounded-xl shadow-lg ">
|
||||
<div class="space-y-1 border-b border-gray-100">
|
||||
<x-responsive-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
|
||||
@@ -371,7 +375,7 @@ x-data="{ menuG:false}"
|
||||
</x-responsive-nav-link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<ul class="block w-11/12 my-4 mx-auto" x-data="{selected:null}">
|
||||
<li class="flex align-center flex-col">
|
||||
<h4 @click="selected !== 0 ? selected = 0 : selected = null"
|
||||
@@ -383,19 +387,19 @@ x-data="{ menuG:false}"
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="mt-8 space-y-1 bg-[#FF5050] mx-4 m-auto rounded-xl ">
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
|
||||
|
||||
<a class="cursor-pointer text-white flex pl-3 pr-4 py-3 text-base font-medium transition duration-150 ease-in-out justify-between" :href="route('logout')"
|
||||
onclick="event.preventDefault();
|
||||
this.closest('form').submit();">
|
||||
<h3 class="mx-4">
|
||||
{{ __('Cerrar Sesión') }}
|
||||
</h3>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" class="w-5 mx-3" x="0" y="0" viewBox="0 0 447.674 447.674" style="enable-background:new 0 0 512 512" xml:space="preserve" class="">
|
||||
<path d="M182.725,379.151c-0.572-1.522-0.769-2.816-0.575-3.863c0.193-1.04-0.472-1.902-1.997-2.566
|
||||
c-1.525-0.664-2.286-1.191-2.286-1.567c0-0.38-1.093-0.667-3.284-0.855c-2.19-0.191-3.283-0.288-3.283-0.288h-3.71h-3.14H82.224
|
||||
@@ -417,13 +421,13 @@ x-data="{ menuG:false}"
|
||||
</a>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="absolute top-4 right-2">
|
||||
<svg x-on:click="menur=false,menus=true" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" version="1.1" class="w-5 cursor-pointer" x="0" y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512" xml:space="preserve">
|
||||
<path d="M17.921,1.505a1.5,1.5,0,0,1-.44,1.06L9.809,10.237a2.5,2.5,0,0,0,0,3.536l7.662,7.662a1.5,1.5,0,0,1-2.121,2.121L7.688,15.9a5.506,5.506,0,0,1,0-7.779L15.36.444a1.5,1.5,0,0,1,2.561,1.061Z" fill="#b221fd" data-original="#000000"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{--menu flaco--}}
|
||||
<div x-cloak x-show="menus" class="bg-[#f2f4ff] h-full shadow-lg rounded-xl ">
|
||||
<div class=" m-auto rounded-2xl py-6">
|
||||
@@ -440,7 +444,7 @@ x-data="{ menuG:false}"
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="bg-[#b221fd] m-auto mb-4 hover:bg-[#7a02b8]">
|
||||
<div class="space-y-1">
|
||||
<x-responsive-nav-link :href="route('perfil')">
|
||||
@@ -466,8 +470,8 @@ x-data="{ menuG:false}"
|
||||
</x-responsive-nav-link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="bg-white m-auto shadow-lg">
|
||||
<div class="space-y-1 border-b border-gray-100">
|
||||
<x-responsive-nav-link class="rounded-none" :href="route('dashboard')" :active="request()->routeIs('dashboard')">
|
||||
@@ -509,11 +513,11 @@ x-data="{ menuG:false}"
|
||||
</x-responsive-nav-link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="space-y-1 bg-[#FF5050] hover:bg-[#ff3131] m-auto mt-8 mb-4">
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
|
||||
|
||||
<a class="cursor-pointer text-white flex pl-3 pr-3 py-3 text-base font-medium transition duration-150 ease-in-out justify-between " :href="route('logout')"
|
||||
onclick="event.preventDefault();
|
||||
this.closest('form').submit();">
|
||||
@@ -538,8 +542,8 @@ x-data="{ menuG:false}"
|
||||
</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+3
-1
@@ -23,7 +23,7 @@ use Illuminate\Support\Facades\Route;
|
||||
Route::get('/',[MenuController::class,'showwelcome' ]);
|
||||
|
||||
Route::any('/dashboard', function () {
|
||||
|
||||
|
||||
return view('dashboard');
|
||||
})->middleware(['auth', 'verified'])->name('dashboard');
|
||||
|
||||
@@ -79,5 +79,7 @@ Route::middleware(["auth", "solo_usuario_administrador"])->group(function () {
|
||||
Route::get('/utilidades',[MenuController::class,'showutilidad' ])->name('utilidades');
|
||||
});
|
||||
|
||||
Route::any('/logs',[MenuController::class,'showlogs' ])->name('logs');
|
||||
Route::any('/log-general',[MenuController::class,'showLogGeneral' ])->name('logGeneral');
|
||||
|
||||
require __DIR__.'/auth.php';
|
||||
|
||||
Reference in New Issue
Block a user