FEATURE: add events to comments

This commit is contained in:
Michal Kváček
2016-09-23 00:41:38 +02:00
parent 0d8e927b08
commit fbb59277b9
12 changed files with 218 additions and 4 deletions
@@ -0,0 +1,30 @@
<?php
namespace Modules\Blog\Article\Providers;
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Modules\Blog\Article\Events\ApprovedComment;
use Modules\Blog\Article\Events\CreatedComment;
use Modules\Blog\Article\Events\DeletedComment;
use Modules\Blog\Article\Listeners\LogCommentApproval;
use Modules\Blog\Article\Listeners\LogDeletedComment;
class ArticleEventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
ApprovedComment::class => [LogCommentApproval::class],
DeletedComment::class => [LogDeletedComment::class],
CreatedComment::class => [LogNewComment::class],
];
public function boot(DispatcherContract $events)
{
parent::boot($events); // TODO: Change the autogenerated stub
}
}
@@ -25,6 +25,8 @@ class ArticleServiceProvider extends ServiceProvider {
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->app->register(ArticleEventServiceProvider::class);
}
/**