Parcourir la source

servicio de Excel y dependecias para PHP Spreadsheet

FREDY il y a 4 mois
Parent
commit
e06444ec68

+ 184 - 0
Back/backendP-Educativa/app/Http/Controllers/NivelExportController.php

@@ -0,0 +1,184 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\DB;
+use PhpOffice\PhpSpreadsheet\Spreadsheet;
+use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
+use PhpOffice\PhpSpreadsheet\Style\Fill;
+use PhpOffice\PhpSpreadsheet\Style\Border;
+use PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
+
+class NivelExportController extends Controller
+{
+ public function exportarExcel()
+{
+
+    $spreadsheet = new Spreadsheet();
+
+    $sheet = $spreadsheet->getActiveSheet();
+
+    // Logo principal en A1 (como encabezado)
+    // $sheet->mergeCells('A1:A2');
+    // $drawing = new Drawing();
+    // $drawing->setName('Logo');
+    // $drawing->setDescription('Logo de la empresa');
+    // $drawing->setPath(public_path('/Logo.png'));
+    // $drawing->setHeight(90);
+    // $drawing->setCoordinates('A1');
+    // $drawing->setOffsetX(30);
+    // $drawing->setOffsetY(15);
+    // $drawing->setWorksheet($sheet);
+
+    $sheet->getRowDimension(1)->setRowHeight(70);
+
+    // Título
+    // Logo principal en A1
+$sheet->mergeCells('A1:P2');
+
+$sheet->setCellValue('A1', 'REPORTE DE NIVELES EDUCATIVOS');
+$sheet->getStyle('A1:P2')->applyFromArray([
+    'font' => [
+        'bold' => true,
+        'size' => 18,
+        'name' => 'Century',
+        'color' => ['rgb' => 'FFFFFF']
+    ],
+    'alignment' => [
+        'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
+        'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
+    ],
+    'fill' => [
+        'fillType' => Fill::FILL_SOLID,
+        'startColor' => ['rgb' => '23255E'], // Azul
+    ],
+    'borders' => [
+        'bottom' => [
+            'borderStyle' => Border::BORDER_THICK,
+            'color' => ['rgb' => 'FFFFFF'],
+        ],
+    ],
+]);
+
+$drawing = new Drawing();
+$drawing->setName('Logo');
+$drawing->setDescription('Logo de la empresa');
+$drawing->setPath(public_path('/Logo.png'));
+$drawing->setHeight(90);
+$drawing->setCoordinates('A1');
+$drawing->setOffsetX(10); // Ajusta según prefieras
+$drawing->setOffsetY(5);
+$drawing->setWorksheet($sheet);
+
+
+    // Subtítulo
+    $sheet->mergeCells('H3:J3');
+    $sheet->setCellValue('H3', 'Este reporte muestra el ID, nombre y estado de los niveles educativos registrados.');
+    $sheet->getStyle('H3')->applyFromArray([
+        'font' => [
+            'italic' => true,
+            'size' => 10,
+            'name' => 'Century',
+            'color' => ['rgb' => '333333']
+        ],
+        'alignment' => [
+            'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
+            'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
+        ],
+    ]);
+
+    // Encabezados en H4
+    $headers = ['ID del Nivel', 'Nombre del Nivel', 'Estado'];
+    $sheet->fromArray($headers, null, 'H4');
+
+    $sheet->getStyle('H4:J4')->applyFromArray([
+        'font' => [
+            'bold' => true,
+            'color' => ['rgb' => 'FFFFFF'],
+            'size' => 12,
+            'name' => 'Century',
+        ],
+        'fill' => [
+            'fillType' => Fill::FILL_SOLID,
+            'startColor' => ['rgb' => '4F81BD'],
+        ],
+        'alignment' => [
+            'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
+            'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
+        ],
+        'borders' => [
+            'allBorders' => [
+                'borderStyle' => Border::BORDER_THIN,
+                'color' => ['rgb' => 'FFFFFF'],
+            ],
+        ],
+    ]);
+
+    // Obtener los datos
+    $niveles = DB::table('niveles')->select('idNivel', 'nombreNivel', 'estado')->get();
+
+    // Insertar los datos en H5+
+// Insertar los datos en H5+
+$row = 5;
+foreach ($niveles as $index => $nivel) {
+    $sheet->setCellValue("H$row", $nivel->idNivel);
+    $sheet->setCellValue("I$row", $nivel->nombreNivel);
+    $sheet->setCellValue("J$row", $nivel->estado);
+
+    // ✅ Altura de fila aumentada (por ejemplo, 25)
+    $sheet->getRowDimension($row)->setRowHeight(25);
+
+    $fillColor = $index % 2 === 0 ? 'D9E1F2' : 'FFFFFF';
+
+    $sheet->getStyle("H$row:J$row")->applyFromArray([
+        'fill' => [
+            'fillType' => Fill::FILL_SOLID,
+            'startColor' => ['rgb' => $fillColor],
+        ],
+        'font' => [
+            'name' => 'Calibri',
+            'size' => 11,
+        ],
+        'borders' => [
+            'allBorders' => [
+                'borderStyle' => Border::BORDER_THIN,
+                'color' => ['rgb' => 'BFBFBF'],
+            ],
+        ],
+    ]);
+    $row++;
+}
+
+
+    // Autoajustar columnas H-J
+    foreach (range('H', 'J') as $col) {
+        $sheet->getColumnDimension($col)->setAutoSize(true);
+    }
+
+    $sheet->setAutoFilter("H4:J4");
+
+
+    $backgroundDrawing = new Drawing();
+    $backgroundDrawing->setName('Marca de Agua');
+    $backgroundDrawing->setDescription('Marca de agua');
+    $backgroundDrawing->setPath(public_path('/MarcaAgua.png'));
+    $backgroundDrawing->setCoordinates('H15'); // Lejana para no estorbar
+    $backgroundDrawing->setHeight(400);
+    $backgroundDrawing->setWorksheet($sheet);
+
+    $writer = new Xlsx($spreadsheet);
+    $filename = 'Niveles_Educativos.xlsx';
+    $tempPath = tempnam(sys_get_temp_dir(), $filename);
+    $writer->save($tempPath);
+
+    return response()->download(
+        $tempPath,
+        $filename,
+        ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']
+
+    );
+
+}
+
+}

+ 6 - 7
Back/backendP-Educativa/app/Http/Middleware/Cors.php

@@ -19,16 +19,15 @@ public function handle(Request $request, Closure $next): Response
     $response = $next($request);
 
     if ($request->is('storage/*')) {
-        $response->header('Access-Control-Allow-Origin', 'http://192.168.100.48:4200');
-        $response->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
-        $response->header('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With, X-Token-Auth');
+        $response->headers->set('Access-Control-Allow-Origin', 'http://192.168.100.48:4200');
+        $response->headers->set('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
+        $response->headers->set('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With, X-Token-Auth');
     } else {
-        $response->header('Access-Control-Allow-Origin', 'http://192.168.100.48:4200')
-                 ->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS')
-                 ->header('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With, X-Token-Auth');
+        $response->headers->set('Access-Control-Allow-Origin', 'http://192.168.100.48:4200');
+        $response->headers->set('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
+        $response->headers->set('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With, X-Token-Auth');
     }
 
     return $response;
 }
-
 }

+ 1 - 0
Back/backendP-Educativa/composer.json

@@ -10,6 +10,7 @@
         "laravel/framework": "^10.10",
         "laravel/sanctum": "^3.3",
         "laravel/tinker": "^2.8",
+        "phpoffice/phpspreadsheet": "^4.3",
         "stechstudio/laravel-jwt": "^1.12",
         "symfony/http-client": "^6.4",
         "symfony/mailgun-mailer": "^6.4"

+ 373 - 3
Back/backendP-Educativa/composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "abe5b8058efd3d697350ea63f39451be",
+    "content-hash": "4e543c7e6b57212aa291590199ce9cbf",
     "packages": [
         {
             "name": "brick/math",
@@ -135,6 +135,85 @@
             ],
             "time": "2023-12-11T17:09:12+00:00"
         },
+        {
+            "name": "composer/pcre",
+            "version": "3.3.2",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/composer/pcre.git",
+                "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
+                "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.4 || ^8.0"
+            },
+            "conflict": {
+                "phpstan/phpstan": "<1.11.10"
+            },
+            "require-dev": {
+                "phpstan/phpstan": "^1.12 || ^2",
+                "phpstan/phpstan-strict-rules": "^1 || ^2",
+                "phpunit/phpunit": "^8 || ^9"
+            },
+            "type": "library",
+            "extra": {
+                "phpstan": {
+                    "includes": [
+                        "extension.neon"
+                    ]
+                },
+                "branch-alias": {
+                    "dev-main": "3.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Composer\\Pcre\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Jordi Boggiano",
+                    "email": "j.boggiano@seld.be",
+                    "homepage": "http://seld.be"
+                }
+            ],
+            "description": "PCRE wrapping library that offers type-safe preg_* replacements.",
+            "keywords": [
+                "PCRE",
+                "preg",
+                "regex",
+                "regular expression"
+            ],
+            "support": {
+                "issues": "https://github.com/composer/pcre/issues",
+                "source": "https://github.com/composer/pcre/tree/3.3.2"
+            },
+            "funding": [
+                {
+                    "url": "https://packagist.com",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/composer",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2024-11-12T16:29:46+00:00"
+        },
         {
             "name": "dflydev/dot-access-data",
             "version": "v3.0.2",
@@ -1945,6 +2024,191 @@
             ],
             "time": "2024-01-28T23:22:08+00:00"
         },
+        {
+            "name": "maennchen/zipstream-php",
+            "version": "3.1.2",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/maennchen/ZipStream-PHP.git",
+                "reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/aeadcf5c412332eb426c0f9b4485f6accba2a99f",
+                "reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f",
+                "shasum": ""
+            },
+            "require": {
+                "ext-mbstring": "*",
+                "ext-zlib": "*",
+                "php-64bit": "^8.2"
+            },
+            "require-dev": {
+                "brianium/paratest": "^7.7",
+                "ext-zip": "*",
+                "friendsofphp/php-cs-fixer": "^3.16",
+                "guzzlehttp/guzzle": "^7.5",
+                "mikey179/vfsstream": "^1.6",
+                "php-coveralls/php-coveralls": "^2.5",
+                "phpunit/phpunit": "^11.0",
+                "vimeo/psalm": "^6.0"
+            },
+            "suggest": {
+                "guzzlehttp/psr7": "^2.4",
+                "psr/http-message": "^2.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "ZipStream\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Paul Duncan",
+                    "email": "pabs@pablotron.org"
+                },
+                {
+                    "name": "Jonatan Männchen",
+                    "email": "jonatan@maennchen.ch"
+                },
+                {
+                    "name": "Jesse Donat",
+                    "email": "donatj@gmail.com"
+                },
+                {
+                    "name": "András Kolesár",
+                    "email": "kolesar@kolesar.hu"
+                }
+            ],
+            "description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
+            "keywords": [
+                "stream",
+                "zip"
+            ],
+            "support": {
+                "issues": "https://github.com/maennchen/ZipStream-PHP/issues",
+                "source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.2"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/maennchen",
+                    "type": "github"
+                }
+            ],
+            "time": "2025-01-27T12:07:53+00:00"
+        },
+        {
+            "name": "markbaker/complex",
+            "version": "3.0.2",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/MarkBaker/PHPComplex.git",
+                "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
+                "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.2 || ^8.0"
+            },
+            "require-dev": {
+                "dealerdirect/phpcodesniffer-composer-installer": "dev-master",
+                "phpcompatibility/php-compatibility": "^9.3",
+                "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
+                "squizlabs/php_codesniffer": "^3.7"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Complex\\": "classes/src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Mark Baker",
+                    "email": "mark@lange.demon.co.uk"
+                }
+            ],
+            "description": "PHP Class for working with complex numbers",
+            "homepage": "https://github.com/MarkBaker/PHPComplex",
+            "keywords": [
+                "complex",
+                "mathematics"
+            ],
+            "support": {
+                "issues": "https://github.com/MarkBaker/PHPComplex/issues",
+                "source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2"
+            },
+            "time": "2022-12-06T16:21:08+00:00"
+        },
+        {
+            "name": "markbaker/matrix",
+            "version": "3.0.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/MarkBaker/PHPMatrix.git",
+                "reference": "728434227fe21be27ff6d86621a1b13107a2562c"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c",
+                "reference": "728434227fe21be27ff6d86621a1b13107a2562c",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.1 || ^8.0"
+            },
+            "require-dev": {
+                "dealerdirect/phpcodesniffer-composer-installer": "dev-master",
+                "phpcompatibility/php-compatibility": "^9.3",
+                "phpdocumentor/phpdocumentor": "2.*",
+                "phploc/phploc": "^4.0",
+                "phpmd/phpmd": "2.*",
+                "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
+                "sebastian/phpcpd": "^4.0",
+                "squizlabs/php_codesniffer": "^3.7"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Matrix\\": "classes/src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Mark Baker",
+                    "email": "mark@demon-angel.eu"
+                }
+            ],
+            "description": "PHP Class for working with matrices",
+            "homepage": "https://github.com/MarkBaker/PHPMatrix",
+            "keywords": [
+                "mathematics",
+                "matrix",
+                "vector"
+            ],
+            "support": {
+                "issues": "https://github.com/MarkBaker/PHPMatrix/issues",
+                "source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1"
+            },
+            "time": "2022-12-02T22:17:43+00:00"
+        },
         {
             "name": "monolog/monolog",
             "version": "3.7.0",
@@ -2445,6 +2709,112 @@
             ],
             "time": "2023-02-08T01:06:31+00:00"
         },
+        {
+            "name": "phpoffice/phpspreadsheet",
+            "version": "4.3.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
+                "reference": "d0ac70d610fb62ccad38c2696569ae1ad42acc70"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/d0ac70d610fb62ccad38c2696569ae1ad42acc70",
+                "reference": "d0ac70d610fb62ccad38c2696569ae1ad42acc70",
+                "shasum": ""
+            },
+            "require": {
+                "composer/pcre": "^1||^2||^3",
+                "ext-ctype": "*",
+                "ext-dom": "*",
+                "ext-fileinfo": "*",
+                "ext-gd": "*",
+                "ext-iconv": "*",
+                "ext-libxml": "*",
+                "ext-mbstring": "*",
+                "ext-simplexml": "*",
+                "ext-xml": "*",
+                "ext-xmlreader": "*",
+                "ext-xmlwriter": "*",
+                "ext-zip": "*",
+                "ext-zlib": "*",
+                "maennchen/zipstream-php": "^2.1 || ^3.0",
+                "markbaker/complex": "^3.0",
+                "markbaker/matrix": "^3.0",
+                "php": "^8.1",
+                "psr/http-client": "^1.0",
+                "psr/http-factory": "^1.0",
+                "psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
+            },
+            "require-dev": {
+                "dealerdirect/phpcodesniffer-composer-installer": "dev-main",
+                "dompdf/dompdf": "^2.0 || ^3.0",
+                "friendsofphp/php-cs-fixer": "^3.2",
+                "mitoteam/jpgraph": "^10.3",
+                "mpdf/mpdf": "^8.1.1",
+                "phpcompatibility/php-compatibility": "^9.3",
+                "phpstan/phpstan": "^1.1 || ^2.0",
+                "phpstan/phpstan-deprecation-rules": "^1.0 || ^2.0",
+                "phpstan/phpstan-phpunit": "^1.0 || ^2.0",
+                "phpunit/phpunit": "^10.5",
+                "squizlabs/php_codesniffer": "^3.7",
+                "tecnickcom/tcpdf": "^6.5"
+            },
+            "suggest": {
+                "dompdf/dompdf": "Option for rendering PDF with PDF Writer",
+                "ext-intl": "PHP Internationalization Functions",
+                "mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
+                "mpdf/mpdf": "Option for rendering PDF with PDF Writer",
+                "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Maarten Balliauw",
+                    "homepage": "https://blog.maartenballiauw.be"
+                },
+                {
+                    "name": "Mark Baker",
+                    "homepage": "https://markbakeruk.net"
+                },
+                {
+                    "name": "Franck Lefevre",
+                    "homepage": "https://rootslabs.net"
+                },
+                {
+                    "name": "Erik Tilt"
+                },
+                {
+                    "name": "Adrien Crivelli"
+                }
+            ],
+            "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
+            "homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
+            "keywords": [
+                "OpenXML",
+                "excel",
+                "gnumeric",
+                "ods",
+                "php",
+                "spreadsheet",
+                "xls",
+                "xlsx"
+            ],
+            "support": {
+                "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
+                "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/4.3.1"
+            },
+            "time": "2025-05-26T18:51:08+00:00"
+        },
         {
             "name": "phpoption/phpoption",
             "version": "1.9.2",
@@ -8549,12 +8919,12 @@
     ],
     "aliases": [],
     "minimum-stability": "stable",
-    "stability-flags": [],
+    "stability-flags": {},
     "prefer-stable": true,
     "prefer-lowest": false,
     "platform": {
         "php": "^8.1"
     },
-    "platform-dev": [],
+    "platform-dev": {},
     "plugin-api-version": "2.6.0"
 }

BIN
Back/backendP-Educativa/public/Layout.png


BIN
Back/backendP-Educativa/public/Logo.png


BIN
Back/backendP-Educativa/public/MarcaAgua.png


BIN
Back/backendP-Educativa/public/logo-abc.png


+ 2 - 2
Back/backendP-Educativa/routes/api.php

@@ -25,6 +25,7 @@ use App\Http\Controllers\Api\NivelEducativoController;
 use App\Http\Controllers\Api\RegistroAcademico;
 use App\Http\Controllers\Api\profesorRegistroBitacora;
 use App\Http\Controllers\Api\RegistroCalicaciones;
+use App\Http\Controllers\NivelExportController;
 
 /*
 |--------------------------------------------------------------------------
@@ -50,13 +51,12 @@ Route::get('ipLocal', [ActividadController::class, 'localIP']);
 Route::put('changePassword', [LoginController::class, 'updatePassword']);
 Route::get('personalizarInfo', [PersonalizarController::class, 'show']);
 Route::post('/send-test-email', [MailController::class, 'sendTestEmail']);
-
+Route::get('/exportar-excel', [NivelExportController::class, 'exportarExcel']);
 
 //protección de rutas
 Route::middleware(['auth:sanctum'])->group(function () {
     Route::get('logout', [LoginController::class, 'logout']);
 
-
     //Rutas de Usuarios
     Route::get('count', [ActividadController::class, 'count']);
     Route::get('usuarioAll', [UserController::class, 'mostrar']);