EventServiceProvider.php 2.4 KB
<?php

namespace FootyRoom\Providers;

use Laravel\Lumen\Providers\EventServiceProvider as ServiceProvider;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        /**
         * Forum posts.
         */
        'FootyRoom\Core\ForumPost\ForumPostPosted' => [
            'FootyRoom\Core\ForumCategory\IncrementPostCountWhenForumPostPosted',
            'FootyRoom\Core\User\IncrementPostCountWhenForumPostPosted',
        ],

        'FootyRoom\Core\ForumPost\Moved' => [
            'FootyRoom\Core\ForumCategory\AdjustPostCountWhenForumPostMoved',
        ],

        /**
         * Comments.
         */
        'FootyRoom\Core\Comment\CommentPosted' => [
            'FootyRoom\Core\User\IncrementCommentCountWhenCommentPosted',
            'FootyRoom\Core\Notification\NotifyWhenCommentPosted',
            // 'FootyRoom\Core\Prerender\PrerenderWhenCommentedOnMatch'
        ],

        'FootyRoom\Core\ForumPost\ForumPostCommentPosted' => [
            'FootyRoom\Core\Subscription\SubscribeToPostWhenCommentPostedInForum',
            'FootyRoom\Core\ForumPost\SetLastCommentWhenCommentPosted',
        ],

        'FootyRoom\Core\Comment\CommentEdited' => [
            'FootyRoom\Core\Comment\CreateRevisionWhenCommentEdited',
        ],

        'FootyRoom\Core\Comment\CommentApproved' => [
            'FootyRoom\Core\Discussion\IncrementCommentCount',
        ],

        'FootyRoom\Core\Comment\CommentRemoved' => [
            'FootyRoom\Core\Discussion\DecrementCommentCount',
            'FootyRoom\Core\Notification\UnnotifyWhenCommentRemoved',
            'FootyRoom\Core\Comment\Flag\ClearFlagsWhenCommentRemoved',
        ],

        /**
         * Predictor.
         */
        'FootyRoom\Core\Predictor\PredictionCreated' => [
            'FootyRoom\Core\Vote\CreateVoteWhenPredicted',
        ],

        'FootyRoom\Core\Predictor\PredictionStakeRaised' => [
            'FootyRoom\Queries\Predictor\PredictorProjector@whenPredictionStakeRaised',
        ],

        /**
         * Auth.
         */
        'auth.login' => [
            'FootyRoom\Listeners\AuthEventListener@newbornCheck',
            'FootyRoom\Listeners\AuthEventListener@recordLogin',
        ]
    ];

    /**
     * The event subscriber mappings for the application.
     *
     * @var array
     */
    protected $subscribe = [];
}