Skip to content

Commit ea34791

Browse files
committed
new isUpdated() method
1 parent 3bf7da4 commit ea34791

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/Controllers/InstallController.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@ public function isInstalled()
111111
|| count($this->migrations_tables) == count($this->inactiveMigrations())
112112
|| in_array('2017_12_25_222719_update_panichd_priorities_add_position', $this->inactiveMigrations()) ) ? false : true;
113113
}
114+
115+
/**
116+
* Check if PanicHD is up to date
117+
*
118+
* @Return bool
119+
*/
120+
public function isUpdated()
121+
{
122+
return (empty($this->inactiveMigrations()) && !$this->inactiveSettings()) ? true : false;
123+
}
114124

115125
/*
116126
* Installation setup

src/PanicHDServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function boot()
4949
'middleware' => $authMiddleware,
5050
'as' => 'panichd.install.setup',
5151
'uses' => 'PanicHD\PanicHD\Controllers\InstallController@setup',
52-
]);
52+
]);
5353

5454
Route::post('/panichd/upgrade', [
5555
'middleware' => $authMiddleware,
@@ -66,7 +66,7 @@ public function boot()
6666
$installer = new InstallController();
6767

6868
// if a migration or new setting is missing scape to the installation
69-
if (empty($installer->inactiveMigrations()) && !$installer->inactiveSettings()) {
69+
if ($installer->isUpdated()) {
7070
// Send the Agent User model to the view under $u
7171
// Send settings to views under $setting
7272

0 commit comments

Comments
 (0)