<?php

namespace App\Providers;

use App\Events\AuthLoginLog;
use App\Events\AuthLogoutLog;
use App\Events\HostelCreated;
use App\Events\HostelCreatedFindNotification;
use App\Events\LogAction;
use App\Listeners\LogEvent;
use App\Listeners\ProcessAchievementWhenFirstHostelCreated;
use App\Listeners\ProcessAchievementWhenHostelCreated;
use Illuminate\Support\Facades\Event;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;

class EventServiceProvider extends ServiceProvider {
	/**
	 * The event listener mappings for the application.
	 *
	 * @var array
	 */
	protected $listen = [
		AuthLoginLog::class  => [
			\App\Listeners\AuthLoginLog::class
		],
		AuthLogoutLog::class => [
			\App\Listeners\AuthLogoutLog::class
		],

		HostelCreated::class                 => [
			\App\Listeners\HostelCreated::class,
			ProcessAchievementWhenHostelCreated::class,
			ProcessAchievementWhenFirstHostelCreated::class
		],
		HostelCreatedFindNotification::class => [
			\App\Listeners\HostelCreated::class,
		],

        LogAction::class => [
            LogEvent::class
        ]
	];

	/**
	 * Register any events for your application.
	 *
	 * @return void
	 */
	public function boot() {
		parent::boot();
	}
}
