Compare commits
2 Commits
953afd02e6
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 0327b95568 | |||
| 9d61186c72 |
24
app/Jobs/LogAppVersionJob.php
Normal file
24
app/Jobs/LogAppVersionJob.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Queue\Queueable;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
final class LogAppVersionJob implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
/**
|
||||
* Log the application version.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$version = config('app.version', 'unknown');
|
||||
|
||||
Log::info("Application version: {$version}");
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
'name' => env('APP_NAME', 'Laravel'),
|
||||
|
||||
'version' => '1.0.0',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Environment
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
<?php
|
||||
|
||||
use App\Jobs\CloseSessionsJob;
|
||||
use App\Jobs\LogAppVersionJob;
|
||||
use Illuminate\Foundation\Inspiring;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schedule;
|
||||
|
||||
Artisan::command('inspire', function () {
|
||||
$this->comment(Inspiring::quote());
|
||||
})->purpose('Display an inspiring quote');
|
||||
|
||||
Schedule::job(new LogAppVersionJob)->hourly();
|
||||
|
||||
Schedule::job(new CloseSessionsJob)->hourly();
|
||||
|
||||
Reference in New Issue
Block a user