upgrade_database(); // Create legal pages and index content for regular license if (get_setting('license') === 'Regular') { $pages = collect(config('content.pages')); $content = collect(config('content.content_regular')); $content->each(function ($content) { Setting::updateOrCreate($content); }); $pages->each(function ($page) { Page::updateOrCreate($page); }); } } /* * Upgrade expire_in in shares table * * @since v1.8 */ if (! Schema::hasTable('traffic') && ! Schema::hasTable('zips') && ! Schema::hasTable('jobs')) { $this->upgrade_database(); } /* * Upgrade expire_in in shares table * * @since v1.8 */ if (! Schema::hasTable('traffic') && ! Schema::hasTable('zips') && ! Schema::hasTable('jobs')) { $this->upgrade_database(); } /* * Upgrade expire_in in shares table * * @since v1.7.9 */ if (! Schema::hasColumn('shares', 'expire_in')) { $this->upgrade_database(); } /* * Upgrade expire_in in shares table * * @since v1.7.11 */ if (! Schema::hasColumn('file_manager_files', 'metadata')) { $this->upgrade_database(); } } /** * @return int|mixed */ private function upgrade_database() { $command = Artisan::call('migrate', [ '--force' => true ]); if ($command === 0) { echo 'Operation was successful.'; } if ($command === 1) { echo 'Operation failed.'; } return $command; } }