From 4f109a3f7f2c29b71b6013b3f53ce4f4366af3a0 Mon Sep 17 00:00:00 2001 From: RAMIRO Date: Tue, 30 Sep 2025 19:03:21 -0500 Subject: [PATCH 01/11] FEAT | Se agergaron nuevas vistas de profesores y estudiantes --- .../developers/chat/externo_chat.blade.php | 2 +- .../chat/externo_chatestudiantes.blade.php | 104 +++++++++++++ .../chat/interno_chatestudiantes.blade.php | 46 ++++++ .../views/students/main-student.blade.php | 117 ++++++++++++++ .../views/students/mainstudent.blade.php | 143 ++++++++++++++---- .../teachers/asig-coordinadores.blade.php | 4 +- .../views/teachers/main-teacher.blade.php | 143 ++++++++++++++++++ .../views/{ => teachers}/pag-status.blade.php | 4 +- .../views/teachers/record-history.blade.php | 69 ++++----- routes/web.php | 53 ++++--- 10 files changed, 595 insertions(+), 90 deletions(-) create mode 100644 resources/views/students/chat/externo_chatestudiantes.blade.php create mode 100644 resources/views/students/chat/interno_chatestudiantes.blade.php create mode 100644 resources/views/students/main-student.blade.php create mode 100644 resources/views/teachers/main-teacher.blade.php rename resources/views/{ => teachers}/pag-status.blade.php (99%) diff --git a/resources/views/developers/chat/externo_chat.blade.php b/resources/views/developers/chat/externo_chat.blade.php index 6e864ea..1175319 100644 --- a/resources/views/developers/chat/externo_chat.blade.php +++ b/resources/views/developers/chat/externo_chat.blade.php @@ -89,7 +89,7 @@ class="w-full px-4 py-2 rounded-full bg-gray-300 text-gray-700 placeholder-gray- - +
+ + +
+ +

S.A.R.A

+ + + + + +
+ + + + + + + + +
+ + +
+ + +
+
+
+

Julian Ramirez

+

Lorem ipsum dolor sit amet...

+
+ + Profesor + +
+ + +
+
+
+

Daniela Saiz

+

Lorem ipsum dolor sit amet...

+
+ + Desconectado + +
+ + +
+
+
+

Julian Ramirez

+

Lorem ipsum dolor sit amet...

+
+ + Estudiante + +
+ + +
+
+
+

Carlos Pérez

+

Lorem ipsum dolor sit amet...

+
+ + Profesor + +
+
+
+ + +
+
+ Logo S.A.R.A +
+
+ +
+ +@endsection + diff --git a/resources/views/students/chat/interno_chatestudiantes.blade.php b/resources/views/students/chat/interno_chatestudiantes.blade.php new file mode 100644 index 0000000..03504bf --- /dev/null +++ b/resources/views/students/chat/interno_chatestudiantes.blade.php @@ -0,0 +1,46 @@ +@extends('templates.students') + +@section('content') + +
+ +
+ + +
+
+

Julian Ramirez

+ Profesor +
+
+ + +
+ +
+
+ Profesor, solicitamos que el dispositivo #4853 sea reiniciado, porque esa porquería no sirve. +
+
+ + +
+
+ Ya que... +
+
+
+ + +
+ + +
+ +
+
+ +@endsection diff --git a/resources/views/students/main-student.blade.php b/resources/views/students/main-student.blade.php new file mode 100644 index 0000000..b5dbdf8 --- /dev/null +++ b/resources/views/students/main-student.blade.php @@ -0,0 +1,117 @@ +@extends('templates.teacher') + +@section('content') +
+

Panel Docente - S.A.R.A

+ + +
+ + +
+

Progreso de asistencias

+
    +
  • + Kristin Watson + 70% +
  • +
  • + Darlene Robertson + 30% +
  • +
  • + Jenny Wilson + 20% +
  • +
  • + Cameron Williamson + 50% +
  • +
  • + Wade Warren + 100% +
  • +
+
+ + +
+

Top estudiantes cumplidos

+
    +
  • + Kristin Watson + 7/10 +
  • +
  • + Darlene Robertson + 3/10 +
  • +
  • + Jenny Wilson + 2/10 +
  • +
  • + Cameron Williamson + 5/10 +
  • +
  • + Wade Warren + 10/10 +
  • +
+
+ + +
+
+

50

+

Refrigerios restantes

+
+
+

126

+

Estudiantes restantes

+
+
+

Iniciado

+

Estado de la jornada

+
+
+ + +
+
+ + +
+

Calendario asistencias

+
+
+
+
+
+
+
+
+
+

Aprende cómo contamos las asistencias

+
+
+ + +
+ + + + +
+ + + +
+@endsection diff --git a/resources/views/students/mainstudent.blade.php b/resources/views/students/mainstudent.blade.php index c098adb..c443a47 100644 --- a/resources/views/students/mainstudent.blade.php +++ b/resources/views/students/mainstudent.blade.php @@ -1,47 +1,132 @@ @extends('templates.students') @section('content') - - -
- -
- -
+
+

BIENVENIDO RAMIRO SOLER

- -
+ +
- -
+ +
+

Porcentaje de asistencia

+
+
+

15%

+

No asistencias

+

5

+

Recuerda presentar excusa

+
+
+

85%

+

Asistencias

+

27

+

Mantén tu compromiso

+
+
+
- -
-
-
+ +
+

Total de registros / días

+
+
+

32

+
+
+ Reclamados + No asistidos + Excusas + Otros +
- -
- -
+ +
+

Calendario asistencias

+
+
+
+
+
+
+
+
+
+
- -
+ +
+
+

Inhabilitado

+

Disponibilidad de perfil

+
+
+

Iniciado

+

Estado de la jornada

+
+
+
- -
+ +
+
+

Faltas

+

5

+

Último mes

+
+
+

Refrigerios

+

32

+

Reclamados

-
+
+ +
+ + Presentar excusa + +
- - +
+

Últimas asistencias

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FechaJornadaTipoEstado
28/09/2025MañanaAlmuerzoAsistencia
27/09/2025TardeRefrigerioFalta
25/09/2025MañanaAlmuerzoExcusa presentada
+
+ @endsection + diff --git a/resources/views/teachers/asig-coordinadores.blade.php b/resources/views/teachers/asig-coordinadores.blade.php index eb44723..44c019c 100644 --- a/resources/views/teachers/asig-coordinadores.blade.php +++ b/resources/views/teachers/asig-coordinadores.blade.php @@ -1,5 +1,5 @@ -@extends('templates.teacher') - +@extends('templates.teachers') +@extends('templates.headers.teacher') @section('content')
diff --git a/resources/views/teachers/main-teacher.blade.php b/resources/views/teachers/main-teacher.blade.php new file mode 100644 index 0000000..726ae2c --- /dev/null +++ b/resources/views/teachers/main-teacher.blade.php @@ -0,0 +1,143 @@ +@extends('templates.teachers') + +@extends('templates.headers.teacher') + +@section('content') + + +
+

BIENVENIDO SANTIAGO PARRAGA

+ + +
+ + +
+

CURSOS POR DIRECTORES DE CURSO

+
    +
  • Kristin Watson70%
  • +
  • Darlene Robertson30%
  • +
  • Jenny Wilson20%
  • +
  • Cameron Williamson50%
  • +
  • Wade Warren100%
  • +
+
+ + +
+

Top estudiantes cumplidos

+
    +
  • Kristin Watson7/10
  • +
  • Darlene Robertson3/10
  • +
  • Jenny Wilson2/10
  • +
  • Cameron Williamson5/10
  • +
  • Wade Warren10/10
  • +
+
+ + +
+

Calendario asistencias

+
+
+
+
+
+
+
+
+
+

Aprende cómo contamos las asistencias

+
+ + +
+
+

Iniciado

+

Estado de la jornada

+
+
+ + +
+
+
+ +
+
+

50

+

Refrigerios restantes

+
+
+

126

+

Estudiantes restantes

+
+
+ + + + +
+

Últimos registros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FechaEstudianteAcciónEstado
28/09/2025Kristin WatsonAlmuerzoReclamado
27/09/2025Jenny WilsonRefrigerioNo asistió
25/09/2025Cameron WilliamsonAlmuerzoExcusa
+
+ + + +
+@endsection diff --git a/resources/views/pag-status.blade.php b/resources/views/teachers/pag-status.blade.php similarity index 99% rename from resources/views/pag-status.blade.php rename to resources/views/teachers/pag-status.blade.php index ced4dd6..0c6d7b6 100644 --- a/resources/views/pag-status.blade.php +++ b/resources/views/teachers/pag-status.blade.php @@ -1,5 +1,5 @@ -@extends('templates.students') - +@extends('templates.teachers') +@extends('templates.headers.teacher') @section('content')
diff --git a/resources/views/teachers/record-history.blade.php b/resources/views/teachers/record-history.blade.php index 6fcee85..4fd620d 100644 --- a/resources/views/teachers/record-history.blade.php +++ b/resources/views/teachers/record-history.blade.php @@ -1,17 +1,18 @@ -@extends('templates.teacher') +@extends('templates.teachers') +@extends('templates.headers.teacher') @section('content') - +
+ class="text-[#F2AC2A] hover:text-yellow-600 transition-transform duration-200 hover:scale-110"> + stroke="currentColor" stroke-width="2"> @@ -19,25 +20,26 @@ class="text-[#F2AC2A] hover:text-yellow-600 transition-transform duration-200 ho
- - - + + +
+ class="px-4 py-2 border rounded-xl focus:ring-2 focus:ring-[#F2AC2A] w-64 transition duration-200 hover:shadow-md"> + class="px-4 py-2 border rounded-xl focus:ring-2 focus:ring-[#F2AC2A] transition duration-200 hover:shadow-md"> + class="px-4 py-2 border rounded-xl focus:ring-2 focus:ring-[#F2AC2A] transition duration-200 hover:shadow-md">
@@ -75,32 +77,28 @@ class="px-4 py-2 border rounded-xl focus:ring-2 focus:ring-[#F2AC2A] transition Entregado - - + + María Gómez - 1234567.890 + 1234567890 24/09/2025 12:10 PM 1002 Sí Almuerzo - boto la papa del almuerzo a la basura + Botó la papa del almuerzo a la basura Prof. Sánchez Pendiente - - + + @@ -110,7 +108,7 @@ class="text-red-500 hover:text-red-700 transition-transform duration-200 hover:s 1098765432 24/09/2025 12:00 PM - 12:20 + 1202 No Ambos - @@ -119,10 +117,8 @@ class="text-red-500 hover:text-red-700 transition-transform duration-200 hover:s Cancelado - - + + @@ -131,17 +127,14 @@ class="text-red-500 hover:text-red-700 transition-transform duration-200 hover:s -
- +
+ - +
+
- - - \ No newline at end of file +@endsection diff --git a/routes/web.php b/routes/web.php index 7f6f3f8..6b1edeb 100644 --- a/routes/web.php +++ b/routes/web.php @@ -7,7 +7,6 @@ use Illuminate\Support\Facades\Route; use Laravel\Fortify\Features; - // Rutas para todos los usuarios ///////////////////////////////////////////////////////////////////////////////////////////////////// // Página principal @@ -15,11 +14,6 @@ return view('landig-page'); })->name('home'); -// Historial -Route::get('/history/cordinadores', function () { - return view('record-history'); -})->name('history');// coordinadores - // Profesores login Route::get('/profesores', function () { return view('profesores'); @@ -40,11 +34,10 @@ return view('advice_page'); })->name('consejos'); - // Contacto de soporte Route::get('/help/soporte', function () { return view('help'); -})->name('quienesomos'); +})->name('soporte'); // Contacto general Route::get('/contact', function () { @@ -62,37 +55,58 @@ })->name('noticias'); // Status - Route::get('/status', function () { return view('status_page'); })->name('status'); - Route::view('dashboard', 'dashboard') ->middleware(['auth', 'verified']) ->name('dashboard'); - ///////////////////////////////////////////////////////////////////////////////////////////////////// -// Rutas para los teachers y coordinadores +// Rutas para los teachers y coordinadores Route::get('/asig-teacher', function () { return view('teachers.asig-coordinadores'); })->name('asignacion-teacher'); +// Historial de estduiantes +Route::get('/history', function () { + return view('teachers.record-history'); +})->name('history'); + +// pagina pricipal de profesores y cordinadores +Route::get('/inicio/profesor', function () { + return view('teachers.main-teacher'); +})->name('inicio-teacher'); + +// configuracion de dispositivos +Route::get('/config/dispositivos', function () { + return view('teachers.pag-status'); +})->name('inicio-teacher'); + -///////////////////////////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////////////////////////////// // Rutas para estudiantes -Route::get('/mockup', function () { + +Route::get('/estudiantes', function () { return view('students.mainstudent'); -})->name('mockup'); +})->name('main-estudiantes'); +Route::get('/est/charsara', function () { + return view('students.chat.externo_chatestudiantes'); +})->name('chat-externo-estudiantes'); + +Route::get('/est/charsara', function () { + return view('students.chat.interno_chatestudiantes'); +})->name('chtat-interno-estudiantes'); @@ -100,11 +114,15 @@ // Rutas para desarrolladores Route::get('/chatsar', function () { return view('developers.chat.interno_chat'); -})->name('chat-sara'); +})->name('chat-interno'); Route::get('/chatsara', function () { return view('developers.chat.externo_chat'); -})->name('chat.sara'); +})->name('chat-externo'); + + + + ///////////////////////////////////////////////////////////////////////////////////////////////////// Route::middleware(['auth'])->group(function () { @@ -126,5 +144,4 @@ ->name('two-factor.show'); }); - require __DIR__ . '/auth.php'; From 378b0b9908471fa9a99fb25579b2b08a2cd0e037 Mon Sep 17 00:00:00 2001 From: RAMIRO Date: Tue, 30 Sep 2025 21:39:54 -0500 Subject: [PATCH 02/11] FIx |arregle los colores --- .../views/teachers/main-teacher.blade.php | 67 +++++++++---------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/resources/views/teachers/main-teacher.blade.php b/resources/views/teachers/main-teacher.blade.php index 726ae2c..db512aa 100644 --- a/resources/views/teachers/main-teacher.blade.php +++ b/resources/views/teachers/main-teacher.blade.php @@ -1,19 +1,16 @@ @extends('templates.teachers') - @extends('templates.headers.teacher') @section('content') +
+

BIENVENIDO SANTIAGO PARRAGA

-
-

BIENVENIDO SANTIAGO PARRAGA

- -
-
-

CURSOS POR DIRECTORES DE CURSO

+
+

CURSOS POR DIRECTORES DE CURSO

  • Kristin Watson70%
  • Darlene Robertson30%
  • @@ -24,7 +21,7 @@
-
+

Top estudiantes cumplidos

  • Kristin Watson7/10
  • @@ -36,31 +33,31 @@
-
+

Calendario asistencias

-
-
-
-
-
-
-
+
+
+
+
+
+
+

Aprende cómo contamos las asistencias

-
+

Iniciado

Estado de la jornada

- -
@@ -68,44 +65,45 @@
-
+

50

Refrigerios restantes

-
+

126

Estudiantes restantes

- -
-

Últimos registros

+

Últimos registros

- + @@ -117,26 +115,25 @@ class="bg-pink-500 text-white py-3 rounded-lg shadow hover:bg-pink-600 flex item - + - + - +
Fecha Estudiante Acción28/09/2025 Kristin Watson AlmuerzoReclamadoReclamado
27/09/2025 Jenny Wilson RefrigerioNo asistióNo asistió
25/09/2025 Cameron Williamson AlmuerzoExcusaExcusa
- -
From ccf178cd6da8ff7f60b54a6f5a31c55eb06b89a4 Mon Sep 17 00:00:00 2001 From: rcomunica Date: Tue, 30 Sep 2025 21:45:26 -0500 Subject: [PATCH 03/11] FEAT | Logic views with Auth now working - FIX | Migrations and OAuth --- app/Http/Controllers/SashaAuthController.php | 4 +- app/Livewire/Students/Main.php | 17 ++ app/Models/Newness.php | 2 +- app/Models/User.php | 7 +- config/livewire.php | 173 ++++++++++++++++++ database/factories/NewnessFactory.php | 2 +- database/factories/RecordFactory.php | 2 +- database/factories/UserFactory.php | 2 +- .../0001_01_01_000000_create_users_table.php | 3 +- ...24_023709_add_custom_columns_to_users.php} | 4 +- ...2025_09_25_220024_create_records_table.php | 6 +- ...25_09_26_000807_create_newnesses_table.php | 2 +- database/seeders/DatabaseSeeder.php | 16 +- .../views/livewire/students/main.blade.php | 3 + .../views/students/mainstudent.blade.php | 72 +++----- .../templates/{dv.blade.php => dev.blade.php} | 8 +- .../views/templates/headers/student.blade.php | 8 +- resources/views/templates/students.blade.php | 14 +- routes/web.php | 6 +- 19 files changed, 268 insertions(+), 83 deletions(-) create mode 100644 app/Livewire/Students/Main.php create mode 100644 config/livewire.php rename database/migrations/{2025_09_28_023709_add_custom_columns_to_users.php => 2025_09_24_023709_add_custom_columns_to_users.php} (93%) create mode 100644 resources/views/livewire/students/main.blade.php rename resources/views/templates/{dv.blade.php => dev.blade.php} (91%) diff --git a/app/Http/Controllers/SashaAuthController.php b/app/Http/Controllers/SashaAuthController.php index e7e359e..1951ef5 100644 --- a/app/Http/Controllers/SashaAuthController.php +++ b/app/Http/Controllers/SashaAuthController.php @@ -80,11 +80,11 @@ public function handleCallback(Request $request) $sashaUser = $userResponse['data']; $user = User::updateOrCreate([ - 'id' => $sashaUser['uuid'], + 'uuid' => $sashaUser['uuid'], ], [ - 'id' => $sashaUser['uuid'], 'name' => $sashaUser["name"], 'last_name' => $sashaUser["last_name"], + 'uuid' => $sashaUser['uuid'], 'email' => $sashaUser['email'], 'grade' => $sashaUser['grade'], 'fingerprint' => $sashaUser['fingerprint'], diff --git a/app/Livewire/Students/Main.php b/app/Livewire/Students/Main.php new file mode 100644 index 0000000..c51fb6d --- /dev/null +++ b/app/Livewire/Students/Main.php @@ -0,0 +1,17 @@ +belongsTo(User::class); + return $this->belongsTo(User::class, 'user_uuid'); } } diff --git a/app/Models/User.php b/app/Models/User.php index f535545..e930b05 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -4,7 +4,6 @@ // use Illuminate\Contracts\Auth\MustVerifyEmail; -use Illuminate\Database\Eloquent\Concerns\HasUuids; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Foundation\Auth\User as Authenticatable; @@ -15,7 +14,7 @@ class User extends Authenticatable { /** @use HasFactory<\Database\Factories\UserFactory> */ - use HasFactory, Notifiable, TwoFactorAuthenticatable, HasUuids; + use HasFactory, Notifiable, TwoFactorAuthenticatable; /** * The attributes that are mass assignable. @@ -23,7 +22,6 @@ class User extends Authenticatable * @var list */ protected $fillable = [ - 'id', 'name', 'last_name', 'email', @@ -38,9 +36,6 @@ class User extends Authenticatable 'rol' ]; - public $incrementing = false; - protected $keyType = 'string'; - /** * The attributes that should be hidden for serialization. * diff --git a/config/livewire.php b/config/livewire.php new file mode 100644 index 0000000..7b523ca --- /dev/null +++ b/config/livewire.php @@ -0,0 +1,173 @@ + 'App\\Livewire', + + /* + |--------------------------------------------------------------------------- + | View Path + |--------------------------------------------------------------------------- + | + | This value is used to specify where Livewire component Blade templates are + | stored when running file creation commands like `artisan make:livewire`. + | It is also used if you choose to omit a component's render() method. + | + */ + + 'view_path' => resource_path('views/livewire'), + + /* + |--------------------------------------------------------------------------- + | Layout + |--------------------------------------------------------------------------- + | The view that will be used as the layout when rendering a single component + | as an entire page via `Route::get('/post/create', CreatePost::class);`. + | In this case, the view returned by CreatePost will render into $slot. + | + */ + + 'layout' => 'templates.general.general', + + /* + |--------------------------------------------------------------------------- + | Lazy Loading Placeholder + |--------------------------------------------------------------------------- + | Livewire allows you to lazy load components that would otherwise slow down + | the initial page load. Every component can have a custom placeholder or + | you can define the default placeholder view for all components below. + | + */ + + 'lazy_placeholder' => null, + + /* + |--------------------------------------------------------------------------- + | Temporary File Uploads + |--------------------------------------------------------------------------- + | + | Livewire handles file uploads by storing uploads in a temporary directory + | before the file is stored permanently. All file uploads are directed to + | a global endpoint for temporary storage. You may configure this below: + | + */ + + 'temporary_file_upload' => [ + 'disk' => null, // Example: 'local', 's3' | Default: 'default' + 'rules' => null, // Example: ['file', 'mimes:png,jpg'] | Default: ['required', 'file', 'max:12288'] (12MB) + 'directory' => null, // Example: 'tmp' | Default: 'livewire-tmp' + 'middleware' => null, // Example: 'throttle:5,1' | Default: 'throttle:60,1' + 'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs... + 'png', + 'gif', + 'bmp', + 'svg', + 'wav', + 'mp4', + 'mov', + 'avi', + 'wmv', + 'mp3', + 'm4a', + 'jpg', + 'jpeg', + 'mpga', + 'webp', + 'wma', + ], + 'max_upload_time' => 5, // Max duration (in minutes) before an upload is invalidated... + 'cleanup' => true, // Should cleanup temporary uploads older than 24 hrs... + ], + + /* + |--------------------------------------------------------------------------- + | Render On Redirect + |--------------------------------------------------------------------------- + | + | This value determines if Livewire will run a component's `render()` method + | after a redirect has been triggered using something like `redirect(...)` + | Setting this to true will render the view once more before redirecting + | + */ + + 'render_on_redirect' => false, + + /* + |--------------------------------------------------------------------------- + | Eloquent Model Binding + |--------------------------------------------------------------------------- + | + | Previous versions of Livewire supported binding directly to eloquent model + | properties using wire:model by default. However, this behavior has been + | deemed too "magical" and has therefore been put under a feature flag. + | + */ + + 'legacy_model_binding' => false, + + /* + |--------------------------------------------------------------------------- + | Auto-inject Frontend Assets + |--------------------------------------------------------------------------- + | + | By default, Livewire automatically injects its JavaScript and CSS into the + | and of pages containing Livewire components. By disabling + | this behavior, you need to use @livewireStyles and @livewireScripts. + | + */ + + 'inject_assets' => true, + + /* + |--------------------------------------------------------------------------- + | Navigate (SPA mode) + |--------------------------------------------------------------------------- + | + | By adding `wire:navigate` to links in your Livewire application, Livewire + | will prevent the default link handling and instead request those pages + | via AJAX, creating an SPA-like effect. Configure this behavior here. + | + */ + + 'navigate' => [ + 'show_progress_bar' => true, + 'progress_bar_color' => '#2299dd', + ], + + /* + |--------------------------------------------------------------------------- + | HTML Morph Markers + |--------------------------------------------------------------------------- + | + | Livewire intelligently "morphs" existing HTML into the newly rendered HTML + | after each update. To make this process more reliable, Livewire injects + | "markers" into the rendered Blade surrounding @if, @class & @foreach. + | + */ + + 'inject_morph_markers' => true, + + /* + |--------------------------------------------------------------------------- + | Pagination Theme + |--------------------------------------------------------------------------- + | + | When enabling Livewire's pagination feature by using the `WithPagination` + | trait, Livewire will use Tailwind templates to render pagination views + | on the page. If you want Bootstrap CSS, you can specify: "bootstrap" + | + */ + + 'pagination_theme' => 'tailwind', +]; diff --git a/database/factories/NewnessFactory.php b/database/factories/NewnessFactory.php index 62b96af..ec8544f 100644 --- a/database/factories/NewnessFactory.php +++ b/database/factories/NewnessFactory.php @@ -19,7 +19,7 @@ class NewnessFactory extends Factory public function definition(): array { return [ - 'user_id' => User::factory(), + 'user_uuid' => User::factory(), 'subject' => $slug = fake()->sentence(), 'slug' => Str::slug($slug), 'text' => fake()->text(), diff --git a/database/factories/RecordFactory.php b/database/factories/RecordFactory.php index 2d69b43..38ff855 100644 --- a/database/factories/RecordFactory.php +++ b/database/factories/RecordFactory.php @@ -24,7 +24,7 @@ public function definition(): array 'date' => fake()->dateTime(), 'record_type' => RecordType::manual, 'journey_id' => Journey::factory(), - 'user_id' => User::factory(), + 'user_uuid' => User::factory(), ]; } } diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 7b2c318..5482560 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -34,8 +34,8 @@ public function definition(): array 'grade' => '1104', 'fingerprint' => fake()->sha256(), 'document' => fake()->numberBetween(1000000000, 1999999999), + 'uuid' => fake()->uuid(), 'document_type' => 'T.I', - 'profile_photo_path' => null, 'rol' => UserRol::Student, ]; } diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php index 4339cea..be3012e 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -12,7 +12,8 @@ public function up(): void { Schema::create('users', function (Blueprint $table) { - $table->uuid('id')->primary(); + $table->id(); + $table->string('name'); $table->string("last_name"); $table->string('email')->unique(); diff --git a/database/migrations/2025_09_28_023709_add_custom_columns_to_users.php b/database/migrations/2025_09_24_023709_add_custom_columns_to_users.php similarity index 93% rename from database/migrations/2025_09_28_023709_add_custom_columns_to_users.php rename to database/migrations/2025_09_24_023709_add_custom_columns_to_users.php index 08c5bee..1c55ccb 100644 --- a/database/migrations/2025_09_28_023709_add_custom_columns_to_users.php +++ b/database/migrations/2025_09_24_023709_add_custom_columns_to_users.php @@ -13,6 +13,8 @@ public function up(): void { Schema::table('users', function (Blueprint $table) { + + $table->uuid("uuid")->unique(); $table->enum("rol", UserRol::cases())->nullable(); $table->string("grade")->nullable(); $table->string("fingerprint")->nullable(); @@ -32,7 +34,7 @@ public function down(): void Schema::table('users', function (Blueprint $table) { $table->dropColumn("grade"); $table->dropColumn("fingerprint"); - $table->dropColumn("UUID"); + $table->dropColumn("uuid"); $table->dropColumn("document"); $table->dropColumn("document_type"); $table->dropColumn("last_login_ip"); diff --git a/database/migrations/2025_09_25_220024_create_records_table.php b/database/migrations/2025_09_25_220024_create_records_table.php index 73e78a9..ddf9b12 100644 --- a/database/migrations/2025_09_25_220024_create_records_table.php +++ b/database/migrations/2025_09_25_220024_create_records_table.php @@ -15,15 +15,15 @@ public function up(): void Schema::create('records', function (Blueprint $table) { $table->id(); - $table->uuid('user_id'); + $table->uuid('user_uuid'); $table->dateTime("date"); $table->enum('record_type', RecordType::cases()); $table->unsignedBigInteger("journey_id"); $table->unsignedBigInteger("device_id")->nullable(); - $table->foreign("user_id") - ->references("id") + $table->foreign("user_uuid") + ->references("uuid") ->on("users") ->onDelete("cascade"); diff --git a/database/migrations/2025_09_26_000807_create_newnesses_table.php b/database/migrations/2025_09_26_000807_create_newnesses_table.php index 68b6091..2fa5bb1 100644 --- a/database/migrations/2025_09_26_000807_create_newnesses_table.php +++ b/database/migrations/2025_09_26_000807_create_newnesses_table.php @@ -13,7 +13,7 @@ public function up(): void { Schema::create('newnesses', function (Blueprint $table) { $table->id(); - $table->uuid("user_id"); + $table->uuid("user_uuid"); $table->string("subject"); $table->text("text"); $table->string("slug"); diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 936e879..5fad375 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -20,14 +20,14 @@ public function run(): void User::factory(10)->create(); - User::factory() - ->has(Newness::factory()->count(3)) - ->create(); + // User::factory() + // ->has(Newness::factory()->count(3)) + // ->create(); - Journey::factory() - ->has(Record::factory() - ->has(User::factory()->count(1)) - ->count(3)) - ->create(); + // Journey::factory() + // ->has(Record::factory() + // ->has(User::factory()->count(1)) + // ->count(3)) + // ->create(); } } diff --git a/resources/views/livewire/students/main.blade.php b/resources/views/livewire/students/main.blade.php new file mode 100644 index 0000000..0bf1ae7 --- /dev/null +++ b/resources/views/livewire/students/main.blade.php @@ -0,0 +1,3 @@ +
+ {{-- Care about people's approval and you will be their prisoner. --}} +
diff --git a/resources/views/students/mainstudent.blade.php b/resources/views/students/mainstudent.blade.php index c098adb..3cde810 100644 --- a/resources/views/students/mainstudent.blade.php +++ b/resources/views/students/mainstudent.blade.php @@ -1,47 +1,35 @@ -@extends('templates.students') - -@section('content') - - - -
- -
- -
- - -
- - -
- - -
-
-
+
+ +
+ +
+ +
+ + +
+ + +
+ + +
+
+
+
-
- -
- -
+ +
+ +
- -
+ +
- -
-
-
- - - - - + +
+
+ -@endsection +
\ No newline at end of file diff --git a/resources/views/templates/dv.blade.php b/resources/views/templates/dev.blade.php similarity index 91% rename from resources/views/templates/dv.blade.php rename to resources/views/templates/dev.blade.php index 97ee08a..b349933 100644 --- a/resources/views/templates/dv.blade.php +++ b/resources/views/templates/dev.blade.php @@ -7,13 +7,13 @@ -
\ No newline at end of file diff --git a/resources/views/templates/headers/teacher.blade.php b/resources/views/templates/headers/teacher.blade.php index 0c63476..b673022 100644 --- a/resources/views/templates/headers/teacher.blade.php +++ b/resources/views/templates/headers/teacher.blade.php @@ -1,34 +1,34 @@
- -
- - + +
+ + - -
- Logo S.A.R.A + +
+ Logo S.A.R.A +
-
- -
-
-

Pepito Perez

-

Grado: 1104

-

- Último inicio de sesión: DD/MM/AAAA -

+ +
+
+

{{Auth::user()->name}} {{Auth::user()->last_name}}

+

Rol: {{Auth::user()->rol}}

+

+ Último inicio de sesión: {{\Carbon\Carbon::parse(Auth::user()->last_login_at)->format('d/m/Y') ?? + ''}} +

+
+ + Usuario
- - Usuario -
-
+ \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 552f9c6..73d7ada 100644 --- a/routes/web.php +++ b/routes/web.php @@ -4,17 +4,18 @@ use App\Livewire\Settings\Password; use App\Livewire\Settings\Profile; use App\Livewire\Settings\TwoFactor; +use App\Livewire\Students\Chat; use App\Livewire\Students\Main as StudentMain; use App\Livewire\Teacher\Main as TeacherMain; +use App\Livewire\Website\Home; +use App\Models\User; use Illuminate\Support\Facades\Route; use Laravel\Fortify\Features; // Rutas para todos los usuarios ///////////////////////////////////////////////////////////////////////////////////////////////////// // Página principal -Route::get('/', function () { - return view('landig-page'); -})->name('home'); +Route::get('/', Home::class)->name('home'); // Historial Route::get('/history/cordinadores', function () { @@ -74,9 +75,10 @@ // Rutas para los teachers y coordinadores -Route::prefix('/docente')->group(function () { +Route::middleware(['teacher', 'auth', 'web'])->prefix('/docente')->group(function () { + Route::get('/', TeacherMain::class)->name('teacher.home'); -})->middleware(['auth', 'auth.session', 'web']); +})->middleware(['web']); @@ -85,39 +87,37 @@ })->name('asignacion-teacher'); -// Historial de estduiantes -Route::get('/history', function () { - return view('teachers.record-history'); -})->name('history'); +// // Historial de estduiantes +// Route::get('/history', function () { +// return view('teachers.record-history'); +// })->name('history'); -// pagina pricipal de profesores y cordinadores -Route::get('/inicio/profesor', function () { - return view('teachers.main-teacher'); -})->name('inicio-teacher'); +// // pagina pricipal de profesores y cordinadores +// Route::get('/inicio/profesor', function () { +// return view('teachers.main-teacher'); +// })->name('inicio-teacher'); -// configuracion de dispositivos -Route::get('/config/dispositivos/status', function () { - return view('teachers.pag-status'); -})->name('inicio-teacher'); +// // configuracion de dispositivos +// Route::get('/config/dispositivos/status', function () { +// return view('teachers.pag-status'); +// })->name('inicio-teacher'); -// configuracion de dispositivos -Route::get('/config/dispositivo/', function () { - return view('teachers.modal-configdispositivo'); -})->name('modal-configdispositivo'); +// // configuracion de dispositivos +// Route::get('/config/dispositivo/', function () { +// return view('teachers.modal-configdispositivo'); +// })->name('modal-configdispositivo'); ///////////////////////////////////////////////////////////////////////////////////////////////////// // Rutas para estudiantes -Route::prefix('/estudiante')->group(function () { +Route::middleware(['student', 'auth', 'web'])->prefix('/estudiante')->group(function () { Route::get('/', StudentMain::class)->name('student.home'); // estudiante/ - Route::get('/chat', function () { - return view('students.mainstudent'); - })->name('student.chat'); -})->middleware(['auth', 'auth.session', 'web']); + Route::get('/chat', Chat::class)->name('student.chat'); +}); diff --git a/tests/Feature/Livewire/Website/HomeTest.php b/tests/Feature/Livewire/Website/HomeTest.php new file mode 100644 index 0000000..9fa7e79 --- /dev/null +++ b/tests/Feature/Livewire/Website/HomeTest.php @@ -0,0 +1,9 @@ +assertStatus(200); +});