mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-06 02:33:48 +00:00
62 lines
1.1 KiB
PHP
62 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\App;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Artisan;
|
|
use Illuminate\Http\Request;
|
|
use Schema;
|
|
|
|
class Maintenance extends Controller
|
|
{
|
|
|
|
/**
|
|
* Start maintenance mode
|
|
*/
|
|
public function up() {
|
|
$command = Artisan::call('up');
|
|
|
|
if ($command === 0) {
|
|
echo 'System is in production mode';
|
|
}
|
|
}
|
|
|
|
/**
|
|
* End maintenance mode
|
|
*/
|
|
public function down() {
|
|
$command = Artisan::call('down');
|
|
|
|
if ($command === 0) {
|
|
echo 'System is in maintenance mode';
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Upgrade database
|
|
*/
|
|
public function upgrade()
|
|
{
|
|
$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;
|
|
}
|
|
}
|