Ejemplo n.º 1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     if (RegistrationStep::count()) {
         return;
     }
     $types = [['title' => 'دبلوم', 'code' => 'D'], ['title' => 'بكالوريوس', 'code' => 'B'], ['title' => 'تكميلي', 'code' => 'C']];
     $period = ['start_at' => date('Y-m-d'), 'finish_at' => date("Y-m-d", strtotime('+1 month', strtotime(date('Y-m-d')))), 'code' => '161', 'academycycle_year_id' => '1'];
     $steps = [['name' => 'تم تقديم طلب', 'verify_email' => 1, 'email_template' => view('registration::steps.templates.verify_email')], ['name' => 'رفع الملفات', 'upload_files' => 1], ['name' => 'الغاء']];
     RegistrationStep::whereNotNull('id')->delete();
     foreach ($steps as $step) {
         RegistrationStep::create($step);
     }
     RegistrationPeriod::whereNotNull('id')->delete();
     RegistrationPeriod::create($period);
     RegistrationType::whereNotNull('id')->delete();
     foreach ($types as $type) {
         RegistrationType::create($type);
     }
 }