Skip to content

Commit 7a69b73

Browse files
authored
Merge pull request #62 from samuelvisscher/feature/add-events
Allow events to be configurable through config
2 parents e378701 + d5a8943 commit 7a69b73

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ return [
7474
'driver' => env('EXPONENT_PUSH_NOTIFICATION_INTERESTS_STORAGE_DRIVER', 'file'),
7575

7676
'database' => [
77+
'events' => [],
78+
7779
'table_name' => 'exponent_push_notification_interests',
7880
],
7981
]

config/exponent-push-notifications.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
'driver' => env('EXPONENT_PUSH_NOTIFICATION_INTERESTS_STORAGE_DRIVER', 'file'),
1212

1313
'database' => [
14+
'events' => [],
15+
1416
'table_name' => 'exponent_push_notification_interests',
1517
],
1618
],

src/Models/Interest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ class Interest extends Model
1313
*/
1414
protected $table;
1515

16+
/**
17+
* The event map for the model.
18+
*
19+
* @var array
20+
*/
21+
protected $dispatchesEvents;
22+
1623
/**
1724
* The attributes that are mass assignable.
1825
*
@@ -37,6 +44,8 @@ class Interest extends Model
3744
*/
3845
public function __construct(array $attributes = [])
3946
{
47+
$this->dispatchesEvents = config('exponent-push-notifications.interests.database.events');
48+
4049
$this->table = config('exponent-push-notifications.interests.database.table_name');
4150

4251
parent::__construct($attributes);

0 commit comments

Comments
 (0)