Skip to content

Commit

Permalink
added exclude prop to ChatSystem::registerObservers
Browse files Browse the repository at this point in the history
  • Loading branch information
myckhel committed Jul 26, 2021
1 parent 4112995 commit c62ea3b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/ChatSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
class ChatSystem
{
use Config;
static function hello() {
return 'hello-world';
}

static function registerPolicies() {
Gate::guessPolicyNamesUsing(function ($modelClass) {
Expand All @@ -19,10 +16,16 @@ static function registerPolicies() {
});
}

static function registerObservers() {
self::config('models.chat_event')
static function registerObservers(array $exclude = []) {
@[
'chat_event' => $chat_event,
'conversation' => $conversation
] = $exclude;

$chat_event != true && self::config('models.chat_event')
::observe(self::config('observers.models.chat_event'));
self::config('models.conversation')

$conversation !== true && self::config('models.conversation')
::observe(self::config('observers.models.conversation'));
}

Expand Down

0 comments on commit c62ea3b

Please sign in to comment.