UnknownSec Bypass
403
:
/
mnt
/
lmsestudio-instance-vol002
/
lms_c210840b5d53
/
database
/
seeds
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
UpdatingSeeder.php
<?php use EstudioLMS\Models\Auth\User; use EstudioLMS\Models\Financial\Duration; use EstudioLMS\Models\Financial\Plan; use Illuminate\Database\Seeder; use EstudioLMS\Models\Auth\Role; use EstudioLMS\Models\Courses\Course\CourseResource; class UpdatingSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { /* Acertando ACL */ if (count(Role::whereName('owner')->first()) <= 0) { $owner = new Role(); $owner->name = 'owner'; $owner->display_name = 'Owner'; // optional $owner->description = 'Administradores desenvolvedores'; // optional $owner->save(); } else { $owner = Role::whereName('owner')->first(); } /* Incluindo usuário owner */ if (count(User::whereEmail('desenv@lms.com')->first()) <= 0) { $newUser = User::create( [ 'name' => 'Product Owner', 'email' => 'desenv@lmsestudio.com.br', 'password' => bcrypt('Owner@13122017'), 'show_admin' => true ] ); $newUser->attachRole($owner); } if (count(Role::whereName('superadmin')->first()) <= 0) { $sAdmin = new Role(); $sAdmin->name = 'superadmin'; $sAdmin->display_name = 'Super Admin'; // optional $sAdmin->description = 'Administrador Principal do Sistema'; // optional $sAdmin->save(); } /* Acertando Tabela de Planos e Incluindo Translatable */ if (!DB::table('plan_translations')->exists()) { DB::statement('SET FOREIGN_KEY_CHECKS=0;'); DB::table('durations')->truncate(); DB::statement('SET FOREIGN_KEY_CHECKS=1;'); DB::statement('SET FOREIGN_KEY_CHECKS=0;'); DB::table('plans')->truncate(); DB::statement('SET FOREIGN_KEY_CHECKS=1;'); DB::statement('SET FOREIGN_KEY_CHECKS=0;'); DB::table('plan_translations')->truncate(); DB::statement('SET FOREIGN_KEY_CHECKS=1;'); for ($i = 1; $i < 100; $i++) { $name = $i == 1 ? ' mes' : ' meses'; Duration::create(['name' => $i . $name, 'duration' => $i]); } $free = Duration::create(['name' => 'Free', 'duration' => 999]); $yearly = Duration::whereDuration(12)->first(); $biannual = Duration::whereDuration(24)->first(); Plan::create( [ 'duration_id' => $yearly['id'], 'pt' => ['name' => 'Plano Anual'], 'en' => ['name' => 'Yearly Plan'], 'es' => ['name' => 'Plano Anual(es)'] ] ); Plan::create( [ 'duration_id' => $biannual['id'], 'pt' => ['name' => 'Plano Bianual'], 'en' => ['name' => 'Biannual Plan'], 'es' => ['name' => 'Plan Bianual(es)'] ] ); Plan::create( [ 'duration_id' => $free['id'], 'pt' => ['name' => 'Plano Gratuíto'], 'en' => ['name' => 'Free Plan'], 'es' => ['name' => 'Plan Gratuito'] ] ); } /* */ if (count(DB::table('gateways')->get()) <= 0) { $this->call('GatewaySeeder'); $this->command->info('Gateways adicionados'); } if (count(DB::table('billing_statuses')->get()) <= 0) { $this->call('BillingStatusTableSeeder'); $this->command->info('Status de Boletos adicionados'); } $this->command->info('Atualização de Dados Finalizada!'); } }
Copyright © 2026 - UnknownSec