File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments