Modificacion de prospecto a alumno y asignacion de grupos, coordinacion académica
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('grupos', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('plan_id');
|
||||
$table->unsignedBigInteger('ciclo');
|
||||
$table->unsignedBigInteger('nivel');
|
||||
$table->unsignedBigInteger('plantel');
|
||||
$table->unsignedBigInteger('turno');
|
||||
$table->boolean('status');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('grupos');
|
||||
}
|
||||
};
|
||||
@@ -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('alumno_grupo', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('alumno_id');
|
||||
$table->foreign('alumno_id')->references('id')->on('alumnos');
|
||||
$table->unsignedBigInteger('grupo_id');
|
||||
$table->foreign('grupo_id')->references('id')->on('grupos');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('alumno_grupo');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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('materias', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('materias');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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('docentes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('docentes');
|
||||
}
|
||||
};
|
||||
@@ -11,11 +11,7 @@ class AlumnoStatusSeeder extends Seeder
|
||||
public function run(): void
|
||||
{
|
||||
DB::table('alumno_status')->insert([
|
||||
'name' => 'activo'
|
||||
]);
|
||||
|
||||
DB::table('alumno_status')->insert([
|
||||
'name' => 'aspirante'
|
||||
'name' => 'prospecto'
|
||||
]);
|
||||
|
||||
DB::table('alumno_status')->insert([
|
||||
@@ -23,7 +19,19 @@ class AlumnoStatusSeeder extends Seeder
|
||||
]);
|
||||
|
||||
DB::table('alumno_status')->insert([
|
||||
'name' => 'baja'
|
||||
'name' => 'alumno'
|
||||
]);
|
||||
|
||||
DB::table('alumno_status')->insert([
|
||||
'name' => 'baja temporal'
|
||||
]);
|
||||
|
||||
DB::table('alumno_status')->insert([
|
||||
'name' => 'baja definitiva'
|
||||
]);
|
||||
|
||||
DB::table('alumno_status')->insert([
|
||||
'name' => 'graduado'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,5 +19,20 @@ class CampanSeeder extends Seeder
|
||||
'periodoFinal'=> '2026-02-28',
|
||||
'status'=>1
|
||||
]);
|
||||
|
||||
Campan::create([
|
||||
'name'=>'FEBRERO - MARZO 2026',
|
||||
'periodoInicial'=> '2026-02-01',
|
||||
'periodoFinal'=> '2026-03-31',
|
||||
'status'=>1
|
||||
]);
|
||||
|
||||
|
||||
Campan::create([
|
||||
'name'=>'ENERO - ABRIL 2026',
|
||||
'periodoInicial'=> '2026-01-01',
|
||||
'periodoFinal'=> '2026-04-30',
|
||||
'status'=>1
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ class ConceptoSeeder extends Seeder
|
||||
'recargo' => '0'
|
||||
]);
|
||||
|
||||
$concepto1->planConceptos()->sync([1]);
|
||||
$concepto1->planConceptos()->sync([1,2]);
|
||||
|
||||
$concepto2=Concepto::create([
|
||||
'name' => '3',
|
||||
@@ -58,7 +58,7 @@ class ConceptoSeeder extends Seeder
|
||||
'tipo' => '1',
|
||||
'recargo' => '0'
|
||||
]);
|
||||
$concepto2->planConceptos()->sync([1]);
|
||||
$concepto2->planConceptos()->sync([1,2]);
|
||||
|
||||
$year=2026;
|
||||
$tipo=1;
|
||||
@@ -79,7 +79,7 @@ class ConceptoSeeder extends Seeder
|
||||
'recargo' => $recargo
|
||||
]);
|
||||
|
||||
$concepto->planConceptos()->sync([1]);
|
||||
$concepto->planConceptos()->sync([1,2]);
|
||||
}
|
||||
$year++;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@ class DatabaseSeeder extends Seeder
|
||||
$this->call(CampanSeeder::class);
|
||||
$this->call(TipoConceptoSeeder::class);
|
||||
$this->call(PlaneSeeder::class);
|
||||
$this->call(PlanSeeder::class);
|
||||
$this->call(ConceptoSeeder::class);
|
||||
$this->call(MaterialSeeder::class);
|
||||
$this->call(GrupoSeeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Alumno;
|
||||
use App\Models\Grupo;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class GrupoSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$grupo = Grupo::create([
|
||||
'plan_id'=> 1,
|
||||
'ciclo'=> 1,
|
||||
'nivel'=> 1,
|
||||
'plantel'=> 3,
|
||||
'turno'=> 1,
|
||||
'status'=> 1
|
||||
]);
|
||||
$grupo->alumnos()->sync([1,2,3,4,5,6,7,8,9,10]);
|
||||
|
||||
for ($i=1; $i <=10 ; $i++) {
|
||||
Alumno::where('id', $i)->update([
|
||||
'status' => 3
|
||||
]);
|
||||
}
|
||||
|
||||
$grupo2 = Grupo::create([
|
||||
'plan_id'=> 2,
|
||||
'ciclo'=> 1,
|
||||
'nivel'=> 2,
|
||||
'plantel'=> 3,
|
||||
'turno'=> 2,
|
||||
'status'=> 1
|
||||
]);
|
||||
$grupo2->alumnos()->sync([16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]);
|
||||
|
||||
for ($i=16; $i <=30 ; $i++) {
|
||||
Alumno::where('id', $i)->update([
|
||||
'status' => 3
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Material;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class MaterialSeeder extends Seeder
|
||||
{
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
|
||||
for ($f=1; $f <=6; $f++) {
|
||||
for($e=1 ; $e <=8 ; $e++) {
|
||||
$fakeWord = fake()->word();
|
||||
$material='';
|
||||
if($f==1){
|
||||
$material= Material::create([
|
||||
'name'=> $fakeWord,
|
||||
'objetivo'=>'desarrollo de material del ciclo'.$e,
|
||||
'creditos'=>10,
|
||||
'ciclo'=>$f,
|
||||
'horas'=>5,
|
||||
'clave'=>$e.'-car',
|
||||
'serial'=>'car',
|
||||
'status'=>1
|
||||
]);
|
||||
$material->carreraMaterial()->sync([1]);
|
||||
}else{
|
||||
$material= Material::create([
|
||||
'name'=> $fakeWord,
|
||||
'objetivo'=>'desarrollo de material del ciclo'.$e,
|
||||
'creditos'=>10,
|
||||
'ciclo'=>$f,
|
||||
'horas'=>5,
|
||||
'clave'=>$e.'-car',
|
||||
'serial'=>'car',
|
||||
'status'=>0
|
||||
]);
|
||||
$material->carreraMaterial()->sync([1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for ($f=1; $f <=10; $f++) {
|
||||
for($e=1 ; $e <=8 ; $e++) {
|
||||
$fakeWord = fake()->word();
|
||||
$material2='';
|
||||
if($f==1){
|
||||
$material2= Material::create([
|
||||
'name'=> $fakeWord,
|
||||
'objetivo'=>'desarrollo de material del ciclo'.$e,
|
||||
'creditos'=>10,
|
||||
'ciclo'=>$f,
|
||||
'horas'=>5,
|
||||
'clave'=>$e.'-car',
|
||||
'serial'=>'car',
|
||||
'status'=>1
|
||||
]);
|
||||
$material2->carreraMaterial()->sync([13]);
|
||||
}else{
|
||||
$material2= Material::create([
|
||||
'name'=> $fakeWord,
|
||||
'objetivo'=>'desarrollo de material del ciclo'.$e,
|
||||
'creditos'=>10,
|
||||
'ciclo'=>$f,
|
||||
'horas'=>5,
|
||||
'clave'=>$e.'-car',
|
||||
'serial'=>'car',
|
||||
'status'=>0
|
||||
]);
|
||||
$material2->carreraMaterial()->sync([13]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -18,13 +18,16 @@ class NivelSeeder extends Seeder
|
||||
'status' => 1
|
||||
]);
|
||||
|
||||
$nivel1->nivelPlantel()->sync(1);
|
||||
$nivel1->nivelPlantel()->sync([1,2,3]);
|
||||
|
||||
Nivel::create([
|
||||
$nivel2= Nivel::create([
|
||||
'name' => 'Licenciatura',
|
||||
'status' => 1
|
||||
]);
|
||||
|
||||
$nivel2->nivelPlantel()->sync([1,2,3]);
|
||||
|
||||
|
||||
Nivel::create([
|
||||
'name' => 'Maestría',
|
||||
'status' => 1
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Plan;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class PlanSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$plan1=Plan::create([
|
||||
'name'=> 'Bachillerato',
|
||||
'rvoe'=>'1234567890',
|
||||
'duracion'=>6,
|
||||
'duration_id'=>1,
|
||||
'nivel'=>1,
|
||||
'carrera'=>2
|
||||
]);
|
||||
$plan1->planesPlantel()->sync([1,2,3]);
|
||||
|
||||
$plan2=Plan::create([
|
||||
'name'=> 'Licenciatura',
|
||||
'rvoe'=>'1234567890',
|
||||
'duracion'=>10,
|
||||
'duration_id'=>2,
|
||||
'nivel'=>2,
|
||||
'carrera'=>14
|
||||
]);
|
||||
|
||||
$plan2->planesPlantel()->sync([1,2,3]);
|
||||
}
|
||||
}
|
||||
@@ -11,9 +11,18 @@ class PlaneSeeder extends Seeder
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
Plane::create([
|
||||
$plan1=Plane::create([
|
||||
'name' => 'BACHILLERATO',
|
||||
'status' => 1
|
||||
]);
|
||||
$plan1->planPlantel()->sync([1,2,3]);
|
||||
|
||||
$plan2=Plane::create([
|
||||
'name' => 'LICENCIATURA',
|
||||
'status' => 1
|
||||
]);
|
||||
|
||||
$plan2->planPlantel()->sync([1,2,3]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,20 +8,21 @@ use Spatie\Permission\Models\Permission;
|
||||
|
||||
class RoleSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
$role1 = Role::create(['name'=>'Admin']);
|
||||
$role2 = Role::create(['name'=>'Blogger']);
|
||||
$role2 = Role::create(['name'=>'Programador']);
|
||||
$role3 = Role::create(['name'=>'Promotor']);
|
||||
$role4 = Role::create(['name'=>'Alumno']);
|
||||
$role5 = Role::create(['name'=>'Control escolar']);
|
||||
$role6 = Role::create(['name'=>'Coordinación académica']);
|
||||
$role7 = Role::create(['name'=>'Docente']);
|
||||
|
||||
Permission::create(['name'=>'note.index','description'=>'Ver notas'])->syncRoles([$role2]);
|
||||
Permission::create(['name'=>'note.create','description'=>'Crear notas'])->syncRoles([$role2]);
|
||||
Permission::create(['name'=>'note.edit','description'=>'Editar notas'])->syncRoles([$role2]);
|
||||
Permission::create(['name'=>'note.destroy','description'=>'Eliminar notas'])->syncRoles([$role2]);
|
||||
Permission::create(['name'=>'note.index','description'=>'Ver notas'])->syncRoles([$role1,$role2,$role3,$role4,$role5]);
|
||||
Permission::create(['name'=>'note.create','description'=>'Crear notas'])->syncRoles([$role1,$role2,$role3,$role4,$role5]);
|
||||
Permission::create(['name'=>'note.edit','description'=>'Editar notas'])->syncRoles([$role1,$role2,$role3,$role4,$role5]);
|
||||
Permission::create(['name'=>'note.destroy','description'=>'Eliminar notas'])->syncRoles([$role1,$role2,$role3,$role4,$role5]);
|
||||
|
||||
Permission::create(['name'=>'user.index','description'=>'Ver usuarios'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'user.create','description'=>'Crear usuarios'])->syncRoles([$role1]);
|
||||
@@ -68,10 +69,10 @@ class RoleSeeder extends Seeder
|
||||
Permission::create(['name'=>'plan.edit','description'=>'Editar planes'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'plan.destroy','description'=>'Eliminar planes'])->syncRoles([$role1]);
|
||||
|
||||
Permission::create(['name'=>'alumno.index','description'=>'Ver alumnos'])->syncRoles([$role1,$role3]);
|
||||
Permission::create(['name'=>'alumno.index','description'=>'Ver alumnos'])->syncRoles([$role1,$role3,$role5]);
|
||||
Permission::create(['name'=>'alumno.create','description'=>'Crear alumnos'])->syncRoles([$role1,$role3]);
|
||||
Permission::create(['name'=>'alumno.edit','description'=>'Editar alumnos'])->syncRoles([$role1,$role3]);
|
||||
Permission::create(['name'=>'alumno.destroy','description'=>'Eliminar alumnos'])->syncRoles([$role1,$role3]);
|
||||
Permission::create(['name'=>'alumno.edit','description'=>'Editar alumnos'])->syncRoles([$role1,$role3,$role5]);
|
||||
Permission::create(['name'=>'alumno.destroy','description'=>'Eliminar alumnos'])->syncRoles([$role1]);
|
||||
|
||||
Permission::create(['name'=>'area.index','description'=>'Ver areas'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'area.create','description'=>'Crear areas'])->syncRoles([$role1]);
|
||||
@@ -120,5 +121,19 @@ class RoleSeeder extends Seeder
|
||||
Permission::create(['name'=>'horario.edit','description'=>'Editar horario'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'horario.destroy','description'=>'Eliminar horario'])->syncRoles([$role1]);
|
||||
|
||||
Permission::create(['name'=>'pago.index','description'=>'Ver pagos'])->syncRoles([$role1,$role3,$role4]);
|
||||
Permission::create(['name'=>'pago.create','description'=>'Crear pagos'])->syncRoles([$role1,$role3]);
|
||||
Permission::create(['name'=>'pago.edit','description'=>'Editar pagos'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'pago.destroy','description'=>'Eliminar pagos'])->syncRoles([$role1,$role3]);
|
||||
|
||||
Permission::create(['name'=>'grupo.index','description'=>'Ver grupos'])->syncRoles([$role1,$role4,$role5,$role6,$role7]);
|
||||
Permission::create(['name'=>'grupo.create','description'=>'Crear grupos'])->syncRoles([$role1,$role5]);
|
||||
Permission::create(['name'=>'grupo.edit','description'=>'Editar grupos'])->syncRoles([$role1,$role5,$role6]);
|
||||
Permission::create(['name'=>'grupo.destroy','description'=>'Eliminar grupos'])->syncRoles([$role1,$role5]);
|
||||
|
||||
Permission::create(['name'=>'docente.index','description'=>'Ver docentes'])->syncRoles([$role1,$role6]);
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,18 @@ class TurnoSeeder extends Seeder
|
||||
'name'=>'Escolarizado',
|
||||
'status'=> 1
|
||||
]);
|
||||
$turno1->turnoPlantel()->sync(1);
|
||||
$turno1->turnoPlantel()->sync([1,2,3,4,5,6]);
|
||||
|
||||
$turno2=Turno::create([
|
||||
'name'=>'Sabatíno',
|
||||
'status'=> 1
|
||||
]);
|
||||
$turno2->turnoPlantel()->sync([1,2,3,4,5,6]);
|
||||
|
||||
$turno3=Turno::create([
|
||||
'name'=>'Mixto',
|
||||
'status'=> 1
|
||||
]);
|
||||
$turno3->turnoPlantel()->sync([1,2,3,4,5,6]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,18 +2,16 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Alumno;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class UserSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$user1= User::create([
|
||||
|
||||
$user= User::create([
|
||||
'name'=>'Luis Fernando',
|
||||
'apellidoPaterno'=>'Pérez',
|
||||
'apellidoMaterno'=>'Luna',
|
||||
@@ -25,19 +23,56 @@ class UserSeeder extends Seeder
|
||||
'status'=>1
|
||||
])->assignRole('Admin');
|
||||
|
||||
$user1->plantelUsuarios()->sync(1);
|
||||
$user->plantelUsuarios()->sync(3);
|
||||
|
||||
$user2= User::create([
|
||||
'name'=>'Antonio Azulito',
|
||||
'apellidoPaterno'=>'Real',
|
||||
$user1= User::create([
|
||||
'name'=>'Crokly',
|
||||
'apellidoPaterno'=>'real',
|
||||
'apellidoMaterno'=>'Luna',
|
||||
'email'=>'reydelfin@gmail.com',
|
||||
'email'=>'fernandoestr61@gmail.com',
|
||||
'direccion'=>'Zacatenco mz 21 lt 2 san francisco cuautliquixca',
|
||||
'telefono'=>'5636287758',
|
||||
'telefono'=>'5636287760',
|
||||
'password' => bcrypt('6686'),
|
||||
'code'=>1,
|
||||
'status'=>1
|
||||
])->assignRole('Admin');
|
||||
$user2->plantelUsuarios()->sync([1,2,3]);
|
||||
])->assignRole('Coordinación académica');
|
||||
|
||||
$user1->plantelUsuarios()->sync(3);
|
||||
|
||||
|
||||
for ($e=1; $e <=2 ; $e++) {
|
||||
for ($i=1; $i <=15; $i++) {
|
||||
$usr = User::create([
|
||||
'name'=>fake('es_MX')->firstName(),
|
||||
'apellidoPaterno'=>fake()->lastName(),
|
||||
'apellidoMaterno'=>fake()->lastName(),
|
||||
'email'=> fake()->email(),
|
||||
'direccion'=>fake()->address(),
|
||||
'telefono'=>fake()->numerify('55########'),
|
||||
'password' => bcrypt('6686'),
|
||||
'code'=>0,
|
||||
'status'=>1
|
||||
])->assignRole('Alumno');
|
||||
$usr->plantelUsuarios()->sync([3]);
|
||||
|
||||
$alumno = Alumno::create([
|
||||
'nivel'=>$e,
|
||||
'plan_id'=>$e,
|
||||
'ciclo'=>3,
|
||||
'turno'=>1,
|
||||
'medio'=>1,
|
||||
'usuario_registro'=>1,
|
||||
'plane_id'=>0,
|
||||
'status'=>2
|
||||
]);
|
||||
$alumno->alumnos()->sync($usr->id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user