-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppServiceProvider.php
52 lines (45 loc) · 1.14 KB
/
AppServiceProvider.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
namespace App\Providers;
use App\Services\PostImportService;
use Illuminate\Queue\Events\JobProcessed;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\ServiceProvider;
use Illuminate\Pagination\Paginator;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Paginator::useBootstrap();
//Code to update the import progress status
Queue::after(function (JobProcessed $event) {
Log::info("Post import success");
(new PostImportService())->updateImportStatus($event->job->getJobId(), true);
});
//$this->addQueryLog();
}
private function addQueryLog() {
DB::listen(function($query) {
Log::info(
$query->sql,
$query->bindings,
$query->time
);
});
}
}