<?php

namespace App\Handlers\Events;

use Tobuli\Entities\User;
use Tobuli\Services\NotificationService;

class AuthLoginEventHandler {

    /**
     * Create the event handler.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  User $user
     * @param  $remember
     * @return void
     */
    public function handle(User $user, $remember)
    {
        session()->set('hash', $user->password_hash);

        $notificationService = new NotificationService();
        $notificationService->check($user);
    }

}