Skip to content

Commit 2f5b83e

Browse files
committed
Document and fix events
1 parent 3292bfc commit 2f5b83e

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

docs/events.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,10 @@ Conner\Tagging\Events\TagAdded;
99
Conner\Tagging\Events\TagRemoved;
1010
```
1111

12-
You can add listeners and track these events.
12+
You can add listeners and track these events.
13+
14+
```php
15+
\Event::listen(Conner\Tagging\Events\TagAdded::class, function($article){
16+
\Log::debug($article->title . ' was tagged');
17+
});
18+
```

src/Events/TagAdded.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use Illuminate\Queue\SerializesModels;
44
use Illuminate\Database\Eloquent\Model;
55

6-
class TagAdded extends Event
6+
class TagAdded
77
{
88
use SerializesModels;
99

src/Events/TagRemoved.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use Illuminate\Queue\SerializesModels;
44
use Illuminate\Database\Eloquent\Model;
55

6-
class TagRemoved extends Event
6+
class TagRemoved
77
{
88
use SerializesModels;
99

0 commit comments

Comments
 (0)