Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
LogUserActivity | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
handle | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace App\Listeners\User; |
4 | |
5 | use App\Events\User\LoggedIn; |
6 | use App\Http\Services\LoginHistoryService; |
7 | use Illuminate\Contracts\Queue\ShouldQueue; |
8 | |
9 | class LogUserActivity implements ShouldQueue |
10 | { |
11 | /** |
12 | * The loginHistory instance. |
13 | * |
14 | * @var LoginHistoryService |
15 | */ |
16 | public $loginHistoryService; |
17 | |
18 | /** |
19 | * Create the event listener. |
20 | * |
21 | * @return void |
22 | */ |
23 | public function __construct(LoginHistoryService $loginHistoryService) |
24 | { |
25 | $this->loginHistoryService = $loginHistoryService; |
26 | } |
27 | |
28 | /** |
29 | * Handle the event. |
30 | */ |
31 | public function handle(LoggedIn $event): void |
32 | { |
33 | $this->loginHistoryService->create($event->user, $event->data['email'], $event->data['signin_source']); |
34 | } |
35 | } |