Primer commit proyecto Laravel

This commit is contained in:
2026-02-05 11:10:09 -06:00
commit e4559106d4
2153 changed files with 210301 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
@extends('layouts.landing')
@section('title',"Crear Rol")
@section('content')
<div class="container-fluid">
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="d-sm-flex align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Crear Rol</h6>
<a href="{{route('role.index')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Regresar</a>
</div>
</div>
<div class="card-body">
<form action="{{route('role.store')}}" method="POST">
@csrf
<div class="mb-3">
<label class="small mb-1">Nombre</label>
<input class="form-control" name="name">
@error('name')
<div class="alert alert-danger">
<strong>{{$message}}</strong>
</div>
@enderror
</div>
<div class="mb-3">
@foreach ($permissions as $permission)
<div class="form-check">
<input type="checkbox" class="form-check-input cb"
id="{{ $permission->id }}"
name="permissions[]" value="{{ $permission->id }}"
>
<label class="form-check-label" for="{{ $permission->id }}">
{{ $permission->description }}
</label>
</div>
@endforeach
</div>
<input class="btn btn-primary" type="submit" value="Create">
</form>
</div>
</div>
</div>
@endsection
+56
View File
@@ -0,0 +1,56 @@
@extends('layouts.landing')
@section('title',"Edit")
@section('content')
<div class="container-fluid">
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="d-sm-flex align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Editar rol</h6>
<a href="{{route('role.index')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Regresar</a>
</div>
</div>
<div class="card-body">
@if (session('info'))
<div class="alert alert-success">
<strong>{{session('info')}}</strong>
</div>
@endif
<a href="{{route('role.index')}}">Regresar</a>
<form action="{{route('role.update',$role->id)}}" method="POST">
@method('PUT')
@csrf
<div class="mb-3">
<label class="small mb-1">Nombre</label>
<input class="form-control" name="name" value="{{ $role->name }}">
@error('name')
<div class="alert alert-danger">
<strong>{{$message}}</strong>
</div>
@enderror
</div>
<div class="mb-3">
@foreach ($permissions as $permission)
<div class="form-check">
<input type="checkbox" class="form-check-input cb"
id="{{ $permission->id }}"
name="permissions[]" value="{{ $permission->id }}"
{{ $role->hasPermissionTo($permission->id) ? 'checked' : '' }}
>
<label class="form-check-label" for="{{ $permission->id }}">
{{ $permission->description }}
</label>
</div>
@endforeach
</div>
<input class="btn btn-primary" type="submit" value="Guardar cambios">
</form>
</div>
</div>
</div>
@endsection
+77
View File
@@ -0,0 +1,77 @@
@extends('layouts.landing')
@section('head')
@include('layouts._partials.tablaStyle')
@endsection
@section('title',"Inicio")
@section('content')
<div class="container-fluid">
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="d-sm-flex align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Roles</h6>
@can('role.create')
<a href="{{route('role.create')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Crear rol</a>
@endcan
</div>
</div>
<div class="card-body">
<div class="container-fluid">
<table id="tcont" class="table table-striped table-bordered nowrap table-hover" style="width:100%;">
<thead>
<tr>
<th>Id</th>
<th>Nombre</th>
<th>descripción</th>
<th>Opciones</th>
</tr>
</thead>
<tbody>
@forelse ($roles as $role)
<tr style="width:100%">
<td>{{$role->id}}</td>
<td><a href="{{route('role.show',$role->id)}}">{{$role->name}}</a></td>
<td>{{$role->guard_name}}</td>
<td class="row mx-auto">
@can('role.edit')
<div class="col-sm-6 col-md-6"><a class="btn btn-primary" href="{{route('role.edit',$role->id)}}">Edit</a></div>
@endcan
@can('role.destroy')
<div class="col-sm-6 col-md-6">
<form class="delete-form" action="{{route('role.destroy',$role->id)}}" method="POST">
@csrf
@method('DELETE')
<input type="submit" value="DELETE" class="btn btn-danger">
</form>
</div>
@endcan
</td>
</tr>
@empty
<p>Sin roles.</p>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@section('scripts')
@include('layouts._partials.tablaScript')
@include('layouts._partials.delete')
@endsection
+22
View File
@@ -0,0 +1,22 @@
@extends('layouts.landing')
@section('title',"show")
@section('content')
<div class="container-fluid">
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="d-sm-flex align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Datos del Rol</h6>
<a href="{{route('role.index')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Regresar</a>
</div>
</div>
<div class="card-body">
<h1>{{$user->name}}</h1>
</div>
</div>
</div>
@endsection