Actualización de moelo user y relación many con asistencias, creación del modelo de asistencia y control por middleware y autenticación
This commit is contained in:
@@ -19,6 +19,7 @@ return new class extends Migration
|
||||
$table->unsignedBigInteger('telefono')->unique();
|
||||
$table->string('direccion');
|
||||
$table->string('password');
|
||||
$table->string('code')->nullable();
|
||||
$table->boolean('status');
|
||||
$table->rememberToken();
|
||||
$table->foreignId('current_team_id')->nullable();
|
||||
|
||||
@@ -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('codes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->dateTime('registro')->nullable();
|
||||
$table->string('latitud');
|
||||
$table->string('longitud');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('codes');
|
||||
}
|
||||
};
|
||||
@@ -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('area_code', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('area_code');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class AreaCodeSeeder extends Seeder
|
||||
{
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
DB::table('area_code')->insert([
|
||||
'name' => 'COR-DSIS'
|
||||
]);
|
||||
|
||||
DB::table('area_code')->insert([
|
||||
'name' => 'COR-PROG'
|
||||
]);
|
||||
|
||||
DB::table('area_code')->insert([
|
||||
'name' => 'COR-CSIS'
|
||||
]);
|
||||
|
||||
DB::table('area_code')->insert([
|
||||
'name' => 'COR-RECU'
|
||||
]);
|
||||
|
||||
DB::table('area_code')->insert([
|
||||
'name' => 'COR-COMP'
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ class DatabaseSeeder extends Seeder
|
||||
{
|
||||
$this->call(RoleSeeder::class);
|
||||
$this->call(PlantelSeeder::class);
|
||||
$this->call(AreaCodeSeeder::class);
|
||||
$this->call(UserSeeder::class);
|
||||
$this->call(NivelSeeder::class);
|
||||
$this->call(DurationSeeder::class);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Spatie\Permission\Models\Role;
|
||||
use Spatie\Permission\Models\Permission;
|
||||
@@ -103,5 +102,14 @@ class RoleSeeder extends Seeder
|
||||
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]);
|
||||
|
||||
Permission::create(['name'=>'code.index','description'=>'Ver asistencia digital'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'code.create','description'=>'Asistencia digital'])->syncRoles([$role1]);
|
||||
|
||||
Permission::create(['name'=>'asistencia.index','description'=>'Ver asistencias'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'asistencia.create','description'=>'Crear asistencias'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'asistencia.edit','description'=>'Editar asistencias'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'asistencia.destroy','description'=>'Eliminar asistencias'])->syncRoles([$role1]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ class UserSeeder extends Seeder
|
||||
'direccion'=>'Zacatenco mz 21 lt 2 san francisco cuautliquixca',
|
||||
'telefono'=>'5636287759',
|
||||
'password' => bcrypt('6686'),
|
||||
'code'=>1,
|
||||
'status'=>1
|
||||
])->assignRole('Admin');
|
||||
|
||||
|
||||
@@ -4,13 +4,10 @@ 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([
|
||||
|
||||
Reference in New Issue
Block a user