package installer
This commit is contained in:
62
app/Http/Controllers/Installer/UpdateController.php
Executable file
62
app/Http/Controllers/Installer/UpdateController.php
Executable file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Installer;
|
||||
|
||||
use Illuminate\Routing\Controller;
|
||||
use App\Helpers\Installer\DatabaseManager;
|
||||
use App\Helpers\Installer\InstalledFileManager;
|
||||
|
||||
class UpdateController extends Controller
|
||||
{
|
||||
use \App\Helpers\Installer\MigrationsHelper;
|
||||
|
||||
/**
|
||||
* Display the updater welcome page.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function welcome()
|
||||
{
|
||||
return view('vendor.installer.update.welcome');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the updater overview page.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function overview()
|
||||
{
|
||||
$migrations = $this->getMigrations();
|
||||
$dbMigrations = $this->getExecutedMigrations();
|
||||
|
||||
return view('vendor.installer.update.overview', ['numberOfUpdatesPending' => count($migrations) - count($dbMigrations)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate and seed the database.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function database()
|
||||
{
|
||||
$databaseManager = new DatabaseManager;
|
||||
$response = $databaseManager->migrateAndSeed();
|
||||
|
||||
return redirect()->route('LaravelUpdater::final')
|
||||
->with(['message' => $response]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update installed file and display finished view.
|
||||
*
|
||||
* @param InstalledFileManager $fileManager
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function finish(InstalledFileManager $fileManager)
|
||||
{
|
||||
$fileManager->update();
|
||||
|
||||
return view('vendor.installer.update.finished');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user