-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
close #782 Enhancement: Schedule Time configuration change
- Loading branch information
1 parent
8b0a1a5
commit 46decc1
Showing
7 changed files
with
56 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace App\Listeners\Updates\V13; | ||
|
||
use App\Events\UpdateFinished; | ||
use App\Listeners\Updates\Listener; | ||
use App\Models\Common\Company; | ||
use App\Utilities\Installer; | ||
use Artisan; | ||
|
||
class Version1313 extends Listener | ||
{ | ||
const ALIAS = 'core'; | ||
|
||
const VERSION = '1.3.13'; | ||
|
||
/** | ||
* Handle the event. | ||
* | ||
* @param $event | ||
* @return void | ||
*/ | ||
public function handle(UpdateFinished $event) | ||
{ | ||
// Check if should listen | ||
if (!$this->check($event)) { | ||
return; | ||
} | ||
|
||
$schedule_time = '09:00'; | ||
|
||
// Get default locale if only 1 company | ||
if (Company::all()->count() == 1) { | ||
$schedule_time = setting('general.schedule_time', '09:00'); | ||
} | ||
|
||
// Set default locale | ||
Installer::updateEnv(['APP_SCHEDULE_TIME' => '"' . $schedule_time . '"']); | ||
|
||
// Update database | ||
Artisan::call('migrate', ['--force' => true]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters