Se crean las especificaciones de los documentos a requerir por nivel, a su vez permitir al alumno subirlos

This commit is contained in:
2026-03-31 11:56:34 -06:00
parent cfd9d2ac68
commit 588a63ed24
61 changed files with 1487 additions and 326 deletions
@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('documento_tipos', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('slug')->unique();
$table->json('extensiones')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('documento_tipos');
}
};
@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('nivel_documento', function (Blueprint $table) {
$table->unsignedBigInteger('documento_tipo_id');
$table->foreign('documento_tipo_id')->references('id')->on('documento_tipos');
$table->unsignedBigInteger('nivel_id');
$table->foreign('nivel_id')->references('id')->on('nivels');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('nivel_documento');
}
};
+1
View File
@@ -28,5 +28,6 @@ class DatabaseSeeder extends Seeder
$this->call(ConceptoSeeder::class);
$this->call(MaterialSeeder::class);
$this->call(GrupoSeeder::class);
$this->call(DocumentoTipoSeeder::class);
}
}
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace Database\Seeders;
use App\Models\DocumentoTipo;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class DocumentoTipoSeeder extends Seeder
{
public function run()
{
DocumentoTipo::insert([
['name' => 'CURP', 'slug' => 'curp','extensiones' => json_encode(['pdf'])],
['name' => 'Acta de nacimiento', 'slug' => 'acta','extensiones' => json_encode(['pdf'])],
['name' => 'Comprobante de domicilio', 'slug' => 'comprobante','extensiones' => json_encode(['pdf'])],
['name' => 'Certificado secundaria', 'slug' => 'certificado_secundaria','extensiones' => json_encode(['pdf'])],
['name' => 'Certificado preparatoria', 'slug' => 'certificado_prepa','extensiones' => json_encode(['pdf'])],
['name' => 'Certificado licenciatura', 'slug' => 'certificado_licenciatura','extensiones' => json_encode(['pdf'])],
['name' => 'Identificación oficial', 'slug' => 'ine','extensiones' => json_encode(['pdf'])],
['name' => 'Certificado médico', 'slug' => 'certificado_medico','extensiones' => json_encode(['pdf'])],
]);
}
}
+5
View File
@@ -135,5 +135,10 @@ class RoleSeeder extends Seeder
Permission::create(['name'=>'docente.create','description'=>'Crear docentes'])->syncRoles([$role1,$role6]);
Permission::create(['name'=>'docente.edit','description'=>'Editar docentes'])->syncRoles([$role1,$role6]);
Permission::create(['name'=>'docente.destroy','description'=>'Eliminar docentes'])->syncRoles([$role1,$role6]);
Permission::create(['name'=>'documentoTipo.index','description'=>'Ver documentos por nivel'])->syncRoles([$role1]);
Permission::create(['name'=>'documentoTipo.create','description'=>'Crear documentos por nivel'])->syncRoles([$role1]);
Permission::create(['name'=>'documentoTipo.edit','description'=>'Editar documentos por nivel'])->syncRoles([$role1]);
Permission::create(['name'=>'documentoTipo.destroy','description'=>'Eliminar documentos por nivel'])->syncRoles([$role1]);
}
}