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
+1
View File
@@ -0,0 +1 @@
*.sqlite*
+72
View File
@@ -0,0 +1,72 @@
<?php
namespace Database\Factories;
use App\Models\Team;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
use Laravel\Jetstream\Features;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
*/
class UserFactory extends Factory
{
/**
* The current password being used by the factory.
*/
protected static ?string $password;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'two_factor_secret' => null,
'two_factor_recovery_codes' => null,
'remember_token' => Str::random(10),
'profile_photo_path' => null,
'current_team_id' => null,
];
}
/**
* Indicate that the model's email address should be unverified.
*/
public function unverified(): static
{
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}
/**
* Indicate that the user should have a personal team.
*/
public function withPersonalTeam(?callable $callback = null): static
{
if (! Features::hasTeamFeatures()) {
return $this->state([]);
}
return $this->has(
Team::factory()
->state(fn (array $attributes, User $user) => [
'name' => $user->name.'\'s Team',
'user_id' => $user->id,
'personal_team' => true,
])
->when(is_callable($callback), $callback),
'ownedTeams'
);
}
}
@@ -0,0 +1,54 @@
<?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('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->unsignedBigInteger('telefono')->unique();
$table->string('direccion');
$table->string('password');
$table->boolean('status');
$table->rememberToken();
$table->foreignId('current_team_id')->nullable();
$table->string('profile_photo_path', 2048)->nullable();
$table->timestamps();
});
Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->longText('payload');
$table->integer('last_activity')->index();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('users');
Schema::dropIfExists('password_reset_tokens');
Schema::dropIfExists('sessions');
}
};
@@ -0,0 +1,35 @@
<?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('cache', function (Blueprint $table) {
$table->string('key')->primary();
$table->mediumText('value');
$table->integer('expiration');
});
Schema::create('cache_locks', function (Blueprint $table) {
$table->string('key')->primary();
$table->string('owner');
$table->integer('expiration');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cache');
Schema::dropIfExists('cache_locks');
}
};
@@ -0,0 +1,57 @@
<?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('jobs', function (Blueprint $table) {
$table->id();
$table->string('queue')->index();
$table->longText('payload');
$table->unsignedTinyInteger('attempts');
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
});
Schema::create('job_batches', function (Blueprint $table) {
$table->string('id')->primary();
$table->string('name');
$table->integer('total_jobs');
$table->integer('pending_jobs');
$table->integer('failed_jobs');
$table->longText('failed_job_ids');
$table->mediumText('options')->nullable();
$table->integer('cancelled_at')->nullable();
$table->integer('created_at');
$table->integer('finished_at')->nullable();
});
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('jobs');
Schema::dropIfExists('job_batches');
Schema::dropIfExists('failed_jobs');
}
};
@@ -0,0 +1,32 @@
<?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('customers', function (Blueprint $table) {
$table->id();
$table->morphs('billable');
$table->string('paddle_id')->unique();
$table->string('name');
$table->string('email');
$table->timestamp('trial_ends_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('customers');
}
};
@@ -0,0 +1,34 @@
<?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('subscriptions', function (Blueprint $table) {
$table->id();
$table->morphs('billable');
$table->string('type');
$table->string('paddle_id')->unique();
$table->string('status');
$table->timestamp('trial_ends_at')->nullable();
$table->timestamp('paused_at')->nullable();
$table->timestamp('ends_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('subscriptions');
}
};
@@ -0,0 +1,34 @@
<?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('subscription_items', function (Blueprint $table) {
$table->id();
$table->foreignId('subscription_id');
$table->string('product_id');
$table->string('price_id');
$table->string('status');
$table->integer('quantity');
$table->timestamps();
$table->unique(['subscription_id', 'price_id']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('subscription_items');
}
};
@@ -0,0 +1,36 @@
<?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('transactions', function (Blueprint $table) {
$table->id();
$table->morphs('billable');
$table->string('paddle_id')->unique();
$table->string('paddle_subscription_id')->nullable()->index();
$table->string('invoice_number')->nullable();
$table->string('status');
$table->string('total');
$table->string('tax');
$table->string('currency', 3);
$table->timestamp('billed_at');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('transactions');
}
};
@@ -0,0 +1,30 @@
<?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('notes', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('description');
$table->unsignedBigInteger('user_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('notes');
}
};
@@ -0,0 +1,135 @@
<?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
{
$teams = config('permission.teams');
$tableNames = config('permission.table_names');
$columnNames = config('permission.column_names');
$pivotRole = $columnNames['role_pivot_key'] ?? 'role_id';
$pivotPermission = $columnNames['permission_pivot_key'] ?? 'permission_id';
throw_if(empty($tableNames), Exception::class, 'Error: config/permission.php not loaded. Run [php artisan config:clear] and try again.');
throw_if($teams && empty($columnNames['team_foreign_key'] ?? null), Exception::class, 'Error: team_foreign_key on config/permission.php not loaded. Run [php artisan config:clear] and try again.');
Schema::create($tableNames['permissions'], static function (Blueprint $table) {
// $table->engine('InnoDB');
$table->bigIncrements('id'); // permission id
$table->string('name'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format)
$table->string('description'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format)
$table->string('guard_name'); // For MyISAM use string('guard_name', 25);
$table->timestamps();
$table->unique(['name', 'guard_name']);
});
Schema::create($tableNames['roles'], static function (Blueprint $table) use ($teams, $columnNames) {
// $table->engine('InnoDB');
$table->bigIncrements('id'); // role id
if ($teams || config('permission.testing')) { // permission.testing is a fix for sqlite testing
$table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable();
$table->index($columnNames['team_foreign_key'], 'roles_team_foreign_key_index');
}
$table->string('name'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format)
$table->string('guard_name'); // For MyISAM use string('guard_name', 25);
$table->timestamps();
if ($teams || config('permission.testing')) {
$table->unique([$columnNames['team_foreign_key'], 'name', 'guard_name']);
} else {
$table->unique(['name', 'guard_name']);
}
});
Schema::create($tableNames['model_has_permissions'], static function (Blueprint $table) use ($tableNames, $columnNames, $pivotPermission, $teams) {
$table->unsignedBigInteger($pivotPermission);
$table->string('model_type');
$table->unsignedBigInteger($columnNames['model_morph_key']);
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_model_id_model_type_index');
$table->foreign($pivotPermission)
->references('id') // permission id
->on($tableNames['permissions'])
->onDelete('cascade');
if ($teams) {
$table->unsignedBigInteger($columnNames['team_foreign_key']);
$table->index($columnNames['team_foreign_key'], 'model_has_permissions_team_foreign_key_index');
$table->primary([$columnNames['team_foreign_key'], $pivotPermission, $columnNames['model_morph_key'], 'model_type'],
'model_has_permissions_permission_model_type_primary');
} else {
$table->primary([$pivotPermission, $columnNames['model_morph_key'], 'model_type'],
'model_has_permissions_permission_model_type_primary');
}
});
Schema::create($tableNames['model_has_roles'], static function (Blueprint $table) use ($tableNames, $columnNames, $pivotRole, $teams) {
$table->unsignedBigInteger($pivotRole);
$table->string('model_type');
$table->unsignedBigInteger($columnNames['model_morph_key']);
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_roles_model_id_model_type_index');
$table->foreign($pivotRole)
->references('id') // role id
->on($tableNames['roles'])
->onDelete('cascade');
if ($teams) {
$table->unsignedBigInteger($columnNames['team_foreign_key']);
$table->index($columnNames['team_foreign_key'], 'model_has_roles_team_foreign_key_index');
$table->primary([$columnNames['team_foreign_key'], $pivotRole, $columnNames['model_morph_key'], 'model_type'],
'model_has_roles_role_model_type_primary');
} else {
$table->primary([$pivotRole, $columnNames['model_morph_key'], 'model_type'],
'model_has_roles_role_model_type_primary');
}
});
Schema::create($tableNames['role_has_permissions'], static function (Blueprint $table) use ($tableNames, $pivotRole, $pivotPermission) {
$table->unsignedBigInteger($pivotPermission);
$table->unsignedBigInteger($pivotRole);
$table->foreign($pivotPermission)
->references('id') // permission id
->on($tableNames['permissions'])
->onDelete('cascade');
$table->foreign($pivotRole)
->references('id') // role id
->on($tableNames['roles'])
->onDelete('cascade');
$table->primary([$pivotPermission, $pivotRole], 'role_has_permissions_permission_id_role_id_primary');
});
app('cache')
->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null)
->forget(config('permission.cache.key'));
}
/**
* Reverse the migrations.
*/
public function down(): void
{
$tableNames = config('permission.table_names');
throw_if(empty($tableNames), Exception::class, 'Error: config/permission.php not found and defaults could not be merged. Please publish the package configuration before proceeding, or drop the tables manually.');
Schema::drop($tableNames['role_has_permissions']);
Schema::drop($tableNames['model_has_roles']);
Schema::drop($tableNames['model_has_permissions']);
Schema::drop($tableNames['roles']);
Schema::drop($tableNames['permissions']);
}
};
@@ -0,0 +1,42 @@
<?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::table('users', function (Blueprint $table) {
$table->text('two_factor_secret')
->after('password')
->nullable();
$table->text('two_factor_recovery_codes')
->after('two_factor_secret')
->nullable();
$table->timestamp('two_factor_confirmed_at')
->after('two_factor_recovery_codes')
->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn([
'two_factor_secret',
'two_factor_recovery_codes',
'two_factor_confirmed_at',
]);
});
}
};
@@ -0,0 +1,33 @@
<?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('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->text('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamp('expires_at')->nullable()->index();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('personal_access_tokens');
}
};
@@ -0,0 +1,32 @@
<?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('plantels', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('razon');
$table->string('ubicacion');
$table->bigInteger('telefono');
$table->boolean('status');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('plantels');
}
};
@@ -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
{
public function up(): void
{
Schema::create('nivels', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->boolean('status');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('nivels');
}
};
@@ -0,0 +1,25 @@
<?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('carreras', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->unsignedBigInteger('nivel');
$table->boolean('status');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('carreras');
}
};
@@ -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('durations', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->boolean('status');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('durations');
}
};
@@ -0,0 +1,33 @@
<?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('plans', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('rvoe');
$table->unsignedBigInteger('duracion');
$table->unsignedBigInteger('duration_id');
$table->unsignedBigInteger('nivel');
$table->unsignedBigInteger('carrera');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('plans');
}
};
@@ -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
{
public function up(): void
{
Schema::create('plan_plantel', function (Blueprint $table) {
$table->unsignedBigInteger('plan_id');
$table->foreign('plan_id')->references('id')->on('plans');
$table->unsignedBigInteger('plantel_id');
$table->foreign('plantel_id')->references('id')->on('plantels');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('plan_plantel');
}
};
@@ -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('plantel_user', function (Blueprint $table) {
$table->unsignedBigInteger('plantel_id');
$table->foreign('plantel_id')->references('id')->on('plantels');
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('plantel_user');
}
};
@@ -0,0 +1,35 @@
<?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('materials', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('objetivo');
$table->bigInteger('creditos');
$table->bigInteger('horas');
$table->bigInteger('ciclo');
$table->string('clave');
$table->string('serial');
$table->boolean('status');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('materials');
}
};
@@ -0,0 +1,28 @@
<?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('carrera_material', function (Blueprint $table) {
$table->unsignedBigInteger('carrera_id');
$table->foreign('carrera_id')->references('id')->on('carreras');
$table->unsignedBigInteger('material_id');
$table->foreign('material_id')->references('id')->on('materials');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('carrera_material');
}
};
@@ -0,0 +1,33 @@
<?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('prospectos', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('nivel');
$table->unsignedBigInteger('plan_id');
$table->unsignedBigInteger('ciclo');
$table->unsignedBigInteger('turno');
$table->unsignedBigInteger('medio');
$table->unsignedBigInteger('usuario_registro');
$table->unsignedBigInteger('plane_id')->default('0');
$table->unsignedBigInteger('status')->default('1');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('prospectos');
}
};
@@ -0,0 +1,25 @@
<?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('prospecto_user', function (Blueprint $table) {
$table->unsignedBigInteger('prospecto_id');
$table->foreign('prospecto_id')->references('id')->on('prospectos');
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('prospecto_user');
}
};
@@ -0,0 +1,28 @@
<?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('areas', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('areas');
}
};
@@ -0,0 +1,30 @@
<?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('area_role', function (Blueprint $table) {
$table->unsignedBigInteger('area_id');
$table->foreign('area_id')->references('id')->on('areas');
$table->unsignedBigInteger('role_id');
$table->foreign('role_id')->references('id')->on('roles');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('area_role');
}
};
@@ -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('tickets', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tickets');
}
};
@@ -0,0 +1,28 @@
<?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('prospecto_status', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('prospecto_status');
}
};
@@ -0,0 +1,31 @@
<?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('campans', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->date('periodoInicial');
$table->date('periodoFinal');
$table->boolean('status');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('campans');
}
};
@@ -0,0 +1,30 @@
<?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_plantel', function (Blueprint $table) {
$table->unsignedBigInteger('nivel_id');
$table->foreign('nivel_id')->references('id')->on('nivels');
$table->unsignedBigInteger('plantel_id');
$table->foreign('plantel_id')->references('id')->on('plantels');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('nivel_plantel');
}
};
@@ -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('turnos', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->boolean('status');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('turnos');
}
};
@@ -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('plantel_turno', function (Blueprint $table) {
$table->unsignedBigInteger('plantel_id');
$table->foreign('plantel_id')->references('id')->on('plantels');
$table->unsignedBigInteger('turno_id');
$table->foreign('turno_id')->references('id')->on('turnos');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('plantel_turno');
}
};
@@ -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('medios', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->boolean('status');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('medios');
}
};
@@ -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('planes', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->boolean('status');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('planes');
}
};
@@ -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
{
public function up(): void
{
Schema::create('conceptos', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->date('fecha_pago');
$table->decimal('monto', 8, 2);
$table->integer('tipo');
$table->boolean('recargo');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('conceptos');
}
};
@@ -0,0 +1,35 @@
<?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('pagos', function (Blueprint $table) {
$table->id();
$table->integer('plans_id');
$table->integer('folio');
$table->integer('concepto');
$table->integer('beca');
$table->decimal('monto', 8, 2);
$table->decimal('pago', 8, 2);
$table->date('fecha_pago');
$table->dateTime('fecha_pagado')->nullable();
$table->unsignedBigInteger('user_id');
$table->unsignedBigInteger('asignacion');
$table->integer('status');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('pagos');
}
};
@@ -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('plane_plantel', function (Blueprint $table) {
$table->unsignedBigInteger('plane_id');
$table->foreign('plane_id')->references('id')->on('planes');
$table->unsignedBigInteger('plantel_id');
$table->foreign('plantel_id')->references('id')->on('plantels');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('plane_plantel');
}
};
@@ -0,0 +1,30 @@
<?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('concepto_plane', function (Blueprint $table) {
$table->unsignedBigInteger('plane_id');
$table->foreign('plane_id')->references('id')->on('planes');
$table->unsignedBigInteger('concepto_id');
$table->foreign('concepto_id')->references('id')->on('conceptos');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('concepto_plane');
}
};
@@ -0,0 +1,28 @@
<?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('tipo_conceptos', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tipo_conceptos');
}
};
+36
View File
@@ -0,0 +1,36 @@
<?php
namespace Database\Seeders;
use App\Models\Area;
use Faker\Guesser\Name;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class AreaSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
Area::create([
'name'=>'Academia'
]);
$area2=Area::create([
'name'=>'Promoción'
]);
$area2->areas()->sync(4);
Area::create([
'name'=>'Finanzas'
]);
Area::create([
'name'=>'Sistemas'
]);
}
}
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace Database\Seeders;
use App\Models\Campan;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class CampanSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
Campan::create([
'name'=>'ENERO - FEBRERO 2026',
'periodoInicial'=> '2026-01-01',
'periodoFinal'=> '2026-02-28',
'status'=>1
]);
}
}
+106
View File
@@ -0,0 +1,106 @@
<?php
namespace Database\Seeders;
use App\Models\Carrera;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class CarreraSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
Carrera::create([
'name'=>'PREPARATORIA CUIEP',
'nivel'=> 1,
'status' => 1
]);
Carrera::create([
'name'=>'PREPARATORIA CON ESPACIALIDAD EN SALUD',
'nivel'=> 1,
'status' => 1
]);
Carrera::create([
'name'=>'PREPARATORIA CON ESPECIALIDAD EN SOFTWARE',
'nivel'=> 1,
'status' => 1
]);
Carrera::create([
'name'=>'PREPARATORIA CON ESPECIALIDAD EN ARTES',
'nivel'=> 1,
'status' => 1
]);
Carrera::create([
'name'=>'PREPARATORIA CON ESPECIALIDAD EN MECÁNICA',
'nivel'=> 1,
'status' => 1
]);
Carrera::create([
'name'=>'Estrategias financieras, mercados y análisis',
'nivel'=> 3,
'status' => 1
]);
Carrera::create([
'name'=>'Protección de sistemas y dato',
'nivel'=> 3,
'status' => 1
]);
Carrera::create([
'name'=>'Terapia familiar, clínica y organizacional',
'nivel'=> 3,
'status' => 1
]);
Carrera::create([
'name'=>'Corporativo, juicios orales, jurisprudencia',
'nivel'=> 3,
'status' => 1
]);
Carrera::create([
'name'=>'Para gestión y liderazgo organizacional',
'nivel'=> 3,
'status' => 1
]);
Carrera::create([
'name'=>'QUIMICO BIOLOGO',
'nivel'=> 2,
'status' => 1
]);
Carrera::create([
'name'=>'DESARROLLO EMPRESARIAL',
'nivel'=> 2,
'status' => 1
]);
Carrera::create([
'name'=>'LINGÜISTICA',
'nivel'=> 2,
'status' => 1
]);
Carrera::create([
'name'=>'SISTEMAS CONTABLES',
'nivel'=> 2,
'status' => 1
]);
Carrera::create([
'name'=>'BANCA Y MERCADOS FINANCIEROS',
'nivel'=> 2,
'status' => 1
]);
}
}
+90
View File
@@ -0,0 +1,90 @@
<?php
namespace Database\Seeders;
use App\Models\Concepto;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class ConceptoSeeder extends Seeder
{
public function run(): void
{
Concepto::create([
'name' => 'SEGURO',
'fecha_pago' => '2026-01-01',
'monto' => '0',
'tipo' => '3',
'recargo' => '0'
]);
Concepto::create([
'name' => 'COLEGIATURA',
'fecha_pago' => '2026-01-01',
'monto' => '0',
'tipo' => '3',
'recargo' => '0'
]);
Concepto::create([
'name' => 'INSCRIPCIÓN',
'fecha_pago' => '2026-01-01',
'monto' => '0',
'tipo' => '3',
'recargo' => '0'
]);
Concepto::create([
'name' => 'REINSCRIPCIÓN',
'fecha_pago' => '2026-01-01',
'monto' => '0',
'tipo' => '3',
'recargo' => '0'
]);
$concepto1=Concepto::create([
'name' => '1',
'fecha_pago' => '2026-01-01',
'monto' => '165',
'tipo' => '1',
'recargo' => '0'
]);
$concepto1->planConceptos()->sync([1]);
$concepto2=Concepto::create([
'name' => '3',
'fecha_pago' => '2026-01-01',
'monto' => '1331',
'tipo' => '1',
'recargo' => '0'
]);
$concepto2->planConceptos()->sync([1]);
$year=2026;
$tipo=1;
$recargo=0;
for ($e=1; $e <=3 ; $e++) {
for ($i=1; $i <=12; $i++) {
if($i==1 && $year==2026){
}else{
$tipo=2;
$recargo=1;
}
$concepto=Concepto::create([
'name' => 2,
'fecha_pago' => $year.'-'.$i.'-01',
'monto' => '2000',
'tipo' => $tipo,
'recargo' => $recargo
]);
$concepto->planConceptos()->sync([1]);
}
$year++;
}
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace Database\Seeders;
use App\Models\User;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
use WithoutModelEvents;
/**
* Seed the application's database.
*/
public function run(): void
{
$this->call(RoleSeeder::class);
$this->call(PlantelSeeder::class);
$this->call(UserSeeder::class);
$this->call(NivelSeeder::class);
$this->call(DurationSeeder::class);
$this->call(CarreraSeeder::class);
$this->call(AreaSeeder::class);
$this->call(prospectoStatusSeeder::class);
$this->call(TurnoSeeder::class);
$this->call(MedioSeeder::class);
$this->call(CampanSeeder::class);
$this->call(TipoConceptoSeeder::class);
$this->call(PlaneSeeder::class);
$this->call(ConceptoSeeder::class);
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Database\Seeders;
use App\Models\Duration;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class DurationSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
Duration::create([
'name' => 'Bimestre',
'status' => 1
]);
Duration::create([
'name' => 'Cuatrimestre',
'status' => 1
]);
Duration::create([
'name' => 'Semestre',
'status' => 1
]);
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Database\Seeders;
use App\Models\Medio;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class MedioSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
Medio::create([
'name'=>'Redes sociales',
'status'=>1
]);
Medio::create([
'name'=>'Triptico',
'status'=>1
]);
Medio::create([
'name'=>'Perifoneo',
'status'=>1
]);
}
}
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace Database\Seeders;
use App\Models\Nivel;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class NivelSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$nivel1= Nivel::create([
'name' => 'Bachillerato',
'status' => 1
]);
$nivel1->nivelPlantel()->sync(1);
Nivel::create([
'name' => 'Licenciatura',
'status' => 1
]);
Nivel::create([
'name' => 'Maestría',
'status' => 1
]);
Nivel::create([
'name' => 'Doctorado',
'status' => 1
]);
}
}
+19
View File
@@ -0,0 +1,19 @@
<?php
namespace Database\Seeders;
use App\Models\Plane;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class PlaneSeeder extends Seeder
{
public function run(): void
{
Plane::create([
'name' => 'LICENCIATURA',
'status' => 1
]);
}
}
+64
View File
@@ -0,0 +1,64 @@
<?php
namespace Database\Seeders;
use App\Models\Plantel;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class PlantelSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
Plantel::create([
'name'=>'Aculco',
'razon'=>'123456789',
'ubicacion'=>'Carretera Aculco-Amealco S/N, 50360 Aculco de Espinoza, Méx.',
'telefono'=>7181240287,
'status'=>1
]);
Plantel::create([
'name'=>'San Juan del Rio',
'razon'=>'123456789',
'ubicacion'=>'5 de Mayo 26, Centro, 76800 San Juan del Río, Qro.',
'telefono'=>4272774826,
'status'=>1
]);
Plantel::create([
'name'=>'Tecámac',
'razon'=>'123456789',
'ubicacion'=>'Carr. México - Pachuca Km. 38.5, Tecámac Centro, Tecamac, 55740 Tecámac de Felipe Villanueva, Méx.',
'telefono'=>5533552116,
'status'=>1
]);
Plantel::create([
'name'=>'Tepeji',
'razon'=>'123456789',
'ubicacion'=>'C. Nigromante #85, San Francisco 1ra, 42854 Tepeji del Río de Ocampo, Hgo.',
'telefono'=>7736826093,
'status'=>1
]);
Plantel::create([
'name'=>'Atlacomulco',
'razon'=>'123456789',
'ubicacion'=>'Legislatura 56, 50450 Atlacomulco de Fabela, Méx.',
'telefono'=>7122174727,
'status'=>1
]);
Plantel::create([
'name'=>'Nopala',
'razon'=>'123456789',
'ubicacion'=>'Prof. Benjamín García Uribe 8, Centro, 42470 Nopala de Villagrán, Hgo.',
'telefono'=>7731328198,
'status'=>1
]);
}
}
+107
View File
@@ -0,0 +1,107 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Role;
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']);
$role3 = Role::create(['name'=>'Promotor']);
$role4 = Role::create(['name'=>'Prospecto']);
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'=>'user.index','description'=>'Ver usuarios'])->syncRoles([$role1]);
Permission::create(['name'=>'user.create','description'=>'Crear usuarios'])->syncRoles([$role1]);
Permission::create(['name'=>'user.edit','description'=>'Editar usuarios'])->syncRoles([$role1]);
Permission::create(['name'=>'user.destroy','description'=>'Eliminar usuarios'])->syncRoles([$role1]);
Permission::create(['name'=>'permission.index','description'=>'Ver permisos'])->syncRoles([$role1]);
Permission::create(['name'=>'permission.create','description'=>'Crear permisos'])->syncRoles([$role1]);
Permission::create(['name'=>'permission.edit','description'=>'Editar permisos'])->syncRoles([$role1]);
Permission::create(['name'=>'permission.destroy','description'=>'Eliminar permisos'])->syncRoles([$role1]);
Permission::create(['name'=>'role.index','description'=>'Ver roles'])->syncRoles([$role1]);
Permission::create(['name'=>'role.create','description'=>'Crear roles'])->syncRoles([$role1]);
Permission::create(['name'=>'role.edit','description'=>'Editar roles'])->syncRoles([$role1]);
Permission::create(['name'=>'role.destroy','description'=>'Eliminar roles'])->syncRoles([$role1]);
Permission::create(['name'=>'plantel.index','description'=>'Ver planteles'])->syncRoles([$role1]);
Permission::create(['name'=>'plantel.create','description'=>'Crear planteles'])->syncRoles([$role1]);
Permission::create(['name'=>'plantel.edit','description'=>'Editar planteles'])->syncRoles([$role1]);
Permission::create(['name'=>'plantel.destroy','description'=>'Eliminar planteles'])->syncRoles([$role1]);
Permission::create(['name'=>'nivel.index','description'=>'Ver niveles'])->syncRoles([$role1]);
Permission::create(['name'=>'nivel.create','description'=>'Crear niveles'])->syncRoles([$role1]);
Permission::create(['name'=>'nivel.edit','description'=>'Editar niveles'])->syncRoles([$role1]);
Permission::create(['name'=>'nivel.destroy','description'=>'Eliminar niveles'])->syncRoles([$role1]);
Permission::create(['name'=>'carrera.index','description'=>'Ver carreras'])->syncRoles([$role1]);
Permission::create(['name'=>'carrera.create','description'=>'Crear carreras'])->syncRoles([$role1]);
Permission::create(['name'=>'carrera.edit','description'=>'Editar carreras'])->syncRoles([$role1]);
Permission::create(['name'=>'carrera.destroy','description'=>'Eliminar carreras'])->syncRoles([$role1]);
Permission::create(['name'=>'material.index','description'=>'Ver materiales'])->syncRoles([$role1]);
Permission::create(['name'=>'material.create','description'=>'Crear materiales'])->syncRoles([$role1]);
Permission::create(['name'=>'material.edit','description'=>'Editar materiales'])->syncRoles([$role1]);
Permission::create(['name'=>'material.destroy','description'=>'Eliminar materiales'])->syncRoles([$role1]);
Permission::create(['name'=>'duration.index','description'=>'Ver duraciones'])->syncRoles([$role1]);
Permission::create(['name'=>'duration.create','description'=>'Crear duraciones'])->syncRoles([$role1]);
Permission::create(['name'=>'duration.edit','description'=>'Editar duraciones'])->syncRoles([$role1]);
Permission::create(['name'=>'duration.destroy','description'=>'Eliminar duraciones'])->syncRoles([$role1]);
Permission::create(['name'=>'plan.index','description'=>'Ver planes'])->syncRoles([$role1]);
Permission::create(['name'=>'plan.create','description'=>'Crear planes'])->syncRoles([$role1]);
Permission::create(['name'=>'plan.edit','description'=>'Editar planes'])->syncRoles([$role1]);
Permission::create(['name'=>'plan.destroy','description'=>'Eliminar planes'])->syncRoles([$role1]);
Permission::create(['name'=>'prospecto.index','description'=>'Ver prospectos'])->syncRoles([$role1,$role3]);
Permission::create(['name'=>'prospecto.create','description'=>'Crear prospectos'])->syncRoles([$role1,$role3]);
Permission::create(['name'=>'prospecto.edit','description'=>'Editar prospectos'])->syncRoles([$role1,$role3]);
Permission::create(['name'=>'prospecto.destroy','description'=>'Eliminar prospectos'])->syncRoles([$role1,$role3]);
Permission::create(['name'=>'area.index','description'=>'Ver areas'])->syncRoles([$role1]);
Permission::create(['name'=>'area.create','description'=>'Crear areas'])->syncRoles([$role1]);
Permission::create(['name'=>'area.edit','description'=>'Editar areas'])->syncRoles([$role1]);
Permission::create(['name'=>'area.destroy','description'=>'Eliminar areas'])->syncRoles([$role1]);
Permission::create(['name'=>'campan.index','description'=>'Ver campañas'])->syncRoles([$role1]);
Permission::create(['name'=>'campan.create','description'=>'Crear campañas'])->syncRoles([$role1]);
Permission::create(['name'=>'campan.edit','description'=>'Editar campañas'])->syncRoles([$role1]);
Permission::create(['name'=>'campan.destroy','description'=>'Eliminar campañas'])->syncRoles([$role1]);
Permission::create(['name'=>'turno.index','description'=>'Ver turnos'])->syncRoles([$role1]);
Permission::create(['name'=>'turno.create','description'=>'Crear turnos'])->syncRoles([$role1]);
Permission::create(['name'=>'turno.edit','description'=>'Editar turnos'])->syncRoles([$role1]);
Permission::create(['name'=>'turno.destroy','description'=>'Eliminar turnos'])->syncRoles([$role1]);
Permission::create(['name'=>'medio.index','description'=>'Ver medios'])->syncRoles([$role1]);
Permission::create(['name'=>'medio.create','description'=>'Crear medios'])->syncRoles([$role1]);
Permission::create(['name'=>'medio.edit','description'=>'Editar medios'])->syncRoles([$role1]);
Permission::create(['name'=>'medio.destroy','description'=>'Eliminar medios'])->syncRoles([$role1]);
Permission::create(['name'=>'plane.index','description'=>'Ver planes de pago'])->syncRoles([$role1]);
Permission::create(['name'=>'plane.create','description'=>'Crear planes de pago'])->syncRoles([$role1]);
Permission::create(['name'=>'plane.edit','description'=>'Editar planes de pago'])->syncRoles([$role1]);
Permission::create(['name'=>'plane.destroy','description'=>'Eliminar planes de pago'])->syncRoles([$role1]);
Permission::create(['name'=>'concepto.index','description'=>'Ver conceptos'])->syncRoles([$role1]);
Permission::create(['name'=>'concepto.create','description'=>'Crear conceptos'])->syncRoles([$role1]);
Permission::create(['name'=>'concepto.edit','description'=>'Editar conceptos'])->syncRoles([$role1]);
Permission::create(['name'=>'concepto.destroy','description'=>'Eliminar conceptos'])->syncRoles([$role1]);
}
}
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace Database\Seeders;
use App\Models\TipoConcepto;
use Illuminate\Database\Seeder;
class TipoConceptoSeeder extends Seeder
{
public function run(): void
{
TipoConcepto::create([
'name' => 'Promoción'
]);
TipoConcepto::create([
'name' => 'Alumno'
]);
TipoConcepto::create([
'name' => 'Planes'
]);
}
}
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace Database\Seeders;
use App\Models\Turno;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class TurnoSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$turno1=Turno::create([
'name'=>'Escolarizado',
'status'=> 1
]);
$turno1->turnoPlantel()->sync(1);
}
}
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace Database\Seeders;
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([
'name'=>'Luis Fernando Pérez',
'email'=>'fernandoestrp@outlook.es',
'direccion'=>'Zacatenco mz 21 lt 2 san francisco cuautliquixca',
'telefono'=>'5636287759',
'password' => bcrypt('6686'),
'status'=>1
])->assignRole('Admin');
$user1->plantelUsuarios()->sync(1);
$user2= User::create([
'name'=>'Antonio Azulito Real Luna',
'email'=>'reydelfin@gmail.com',
'direccion'=>'Zacatenco mz 21 lt 2 san francisco cuautliquixca',
'telefono'=>'5636287758',
'password' => bcrypt('2000'),
'status'=>1
])->assignRole('Promotor');
$user2->plantelUsuarios()->sync([1,2,3]);
}
}
@@ -0,0 +1,40 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
class prospectoStatusSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
DB::table('prospecto_status')->insert([
'name' => 'activo',
'created_at' => now(),
'updated_at' => now(),
]);
DB::table('prospecto_status')->insert([
'name' => 'aspirante',
'created_at' => now(),
'updated_at' => now(),
]);
DB::table('prospecto_status')->insert([
'name' => 'inscrito',
'created_at' => now(),
'updated_at' => now(),
]);
DB::table('prospecto_status')->insert([
'name' => 'baja',
'created_at' => now(),
'updated_at' => now(),
]);
}
}