1.0.1 : Runs scheduled only on production

This commit is contained in:
Vincent BRIDIER 2022-07-04 11:41:39 +02:00
parent a6d168f573
commit 24e36b8c63
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
3 changed files with 10 additions and 5 deletions

View file

@ -2,7 +2,7 @@
## Install on Laravel
```
composer req ldc/web-admin-secure-laravel:1.0.0
composer req ldc/web-admin-secure-laravel:1.0.1
```
.env.example :
@ -26,3 +26,4 @@ Put 'admin-secure' middleware on route to protect it.
Nothing to do command is already configureed to run everyday.
You just need to install this package.
**!! Runs only in production !!**

View file

@ -1,4 +1,6 @@
# Changelog
## **Version 1.0.1**
*Changed*
- Run scheduled only on production envirronement
## **Version 1.0.0**
### Initial release

View file

@ -30,9 +30,11 @@ class AdminSecureServiceProvider extends ServiceProvider
// * Cron Report everyday
$this->app->booted(function () {
/** @var \Illuminate\Console\Scheduling\Schedule */
$schedule = $this->app->make(Schedule::class);
$schedule->command('ldcweb:admin-secure-sync')->daily();
if ($this->app->environment('production')) {
/** @var \Illuminate\Console\Scheduling\Schedule */
$schedule = $this->app->make(Schedule::class);
$schedule->command('ldcweb:admin-secure-sync')->daily();
}
});
$router = $this->app->make(Router::class);