public function dbMigrate($input)
{
$rules = array('username' => 'required', 'email' => 'required|email', 'first_name' => 'required', 'last_name' => 'required', 'password' => 'required|min:6|confirmed', 'password_confirmation' => 'required|min:6');
$messages = array();
$validation = Validator::make($input, $rules, $messages);
if ($validation->fails()) {
return $this->listener->validationErrors($validation->messages());
}
$env = array('TIME_ZONE' => $input['time_zone']);
$this->setEnvironmentVariables($env);
try {
@ini_set('max_execution_time', 0);
// Temporarily increase maximum execution time
Artisan::call('vendor:publish', ['--provider' => 'Barryvdh\\TranslationManager\\ManagerServiceProvider', '--tag' => ['migrations']]);
// Migrate all the tables
Artisan::call('migrate');
Artisan::call('vendor:publish', ['--provider' => 'Barryvdh\\TranslationManager\\ManagerServiceProvider', '--tag' => ['config']]);
Artisan::call('migrate', ['--path' => 'app/Components/posts/database/migrations/']);
Artisan::call('migrate', ['--path' => 'app/Modules/Doptor/Slideshow/Database/Migrations/']);
Artisan::call('migrate', ['--path' => 'app/Components/MediaManager/database/migrations/']);
Artisan::call('migrate', ['--path' => 'app/Components/theme_manager/database/migrations/']);
Artisan::call('migrate', ['--path' => 'app/Components/ContactManager/Database/Migrations/']);
Artisan::call('migrate', ['--path' => 'app/Components/ReportBuilder/Database/Migrations/']);
Artisan::call('migrate', ['--path' => 'app/Components/ReportGenerator/Database/Migrations/']);
Artisan::call('migrate', ['--path' => 'app/Modules/Doptor/CompanyInfo/Database/Migrations/']);
Artisan::call('migrate', ['--path' => 'app/Modules/Doptor/TranslationManager/Database/Migrations/']);
$this->createSuperAdmin($input);
if (isset($input['sample_data']) && $input['sample_data'] == 'true') {
// Install sample seed data
Artisan::call('db:seed');
}
Artisan::call('db:seed', ['--class' => 'MenuPositionTableSeeder']);
Artisan::call('db:seed', ['--class' => 'ThemesTableSeeder']);
Artisan::call('db:seed', ['--class' => 'Modules\\Doptor\\CompanyInfo\\Database\\Seeds\\CountriesTableSeeder']);
Artisan::call('db:seed', ['--class' => 'Modules\\Doptor\\TranslationManager\\Database\\Seeds\\ModulesTableSeeder']);
Artisan::call('db:seed', ['--class' => 'Modules\\Doptor\\TranslationManager\\Database\\Seeds\\LanguageTableSeeder']);
Artisan::call('db:seed', ['--class' => 'Modules\\Doptor\\CompanyInfo\\Database\\Seeds\\ModulesTableSeeder']);
Artisan::call('db:seed', ['--class' => 'Modules\\Doptor\\Slideshow\\Database\\Seeds\\ModulesTableSeeder']);
} catch (Exception $e) {
return $this->listener->installerFails($e->getMessage());
}
Event::fire(new InstallationWasCompleted());
return Redirect::to('/');
}