@@ -83,7 +83,7 @@ class Discussion extends Model implements DiscussionContract
83
83
public function __construct (array $ attributes = [])
84
84
{
85
85
$ this ->setTable (
86
- config ('laravel- messenger.discussions.table ' , 'discussions ' )
86
+ config ('messenger.discussions.table ' , 'discussions ' )
87
87
);
88
88
89
89
parent ::__construct ($ attributes );
@@ -102,7 +102,7 @@ public function __construct(array $attributes = [])
102
102
public function participations ()
103
103
{
104
104
return $ this ->hasMany (
105
- config ('laravel- messenger.participations.model ' , Participation::class)
105
+ config ('messenger.participations.model ' , Participation::class)
106
106
);
107
107
}
108
108
@@ -114,7 +114,7 @@ public function participations()
114
114
public function messages ()
115
115
{
116
116
return $ this ->hasMany (
117
- config ('laravel- messenger.messages.model ' , Message::class)
117
+ config ('messenger.messages.model ' , Message::class)
118
118
);
119
119
}
120
120
@@ -146,7 +146,7 @@ public function scopeForUser(Builder $query, EloquentModel $participable)
146
146
$ table = $ this ->getParticipationsTable ();
147
147
148
148
return $ query ->join ($ table , function (JoinClause $ join ) use ($ table , $ participable ) {
149
- $ morph = config ('laravel- messenger.users.morph ' , 'participable ' );
149
+ $ morph = config ('messenger.users.morph ' , 'participable ' );
150
150
151
151
$ join ->on ($ this ->getQualifiedKeyName (), '= ' , "{$ table }.discussion_id " )
152
152
->where ("{$ table }. {$ morph }_type " , '= ' , $ participable ->getMorphClass ())
@@ -201,7 +201,7 @@ public function scopeForUserWithNewMessages(Builder $query, EloquentModel $parti
201
201
public function scopeBetween (Builder $ query , $ participables )
202
202
{
203
203
return $ query ->whereHas ($ this ->getParticipationsTable (), function (Builder $ query ) use ($ participables ) {
204
- $ morph = config ('laravel- messenger.users.morph ' , 'participable ' );
204
+ $ morph = config ('messenger.users.morph ' , 'participable ' );
205
205
$ index = 0 ;
206
206
207
207
foreach ($ participables as $ participable ) {
@@ -257,7 +257,7 @@ public function getLatestMessageAttribute()
257
257
*/
258
258
protected function getParticipationsTable ()
259
259
{
260
- return config ('laravel- messenger.participations.table ' , 'participations ' );
260
+ return config ('messenger.participations.table ' , 'participations ' );
261
261
}
262
262
263
263
/* -----------------------------------------------------------------
@@ -315,7 +315,7 @@ public function getParticipables()
315
315
*/
316
316
public function addParticipant (EloquentModel $ participable )
317
317
{
318
- $ morph = config ('laravel- messenger.users.morph ' , 'participable ' );
318
+ $ morph = config ('messenger.users.morph ' , 'participable ' );
319
319
320
320
return $ this ->participations ()->firstOrCreate ([
321
321
"{$ morph }_id " => $ participable ->getKey (),
@@ -363,7 +363,7 @@ public function removeParticipant(EloquentModel $participable, $reload = true)
363
363
*/
364
364
public function removeParticipants ($ participables , $ reload = true )
365
365
{
366
- $ morph = config ('laravel- messenger.users.morph ' , 'participable ' );
366
+ $ morph = config ('messenger.users.morph ' , 'participable ' );
367
367
$ deleted = 0 ;
368
368
369
369
foreach ($ participables as $ participable ) {
@@ -420,7 +420,7 @@ public function isUnread(EloquentModel $participable)
420
420
*/
421
421
public function getParticipationByParticipable (EloquentModel $ participable )
422
422
{
423
- $ morph = config ('laravel- messenger.users.morph ' , 'participable ' );
423
+ $ morph = config ('messenger.users.morph ' , 'participable ' );
424
424
425
425
return $ this ->participations ()
426
426
->where ("{$ morph }_type " , '= ' , $ participable ->getMorphClass ())
@@ -491,7 +491,7 @@ public function participationsString($callback = null, $glue = ', ')
491
491
*/
492
492
public function hasParticipation (EloquentModel $ participable )
493
493
{
494
- $ morph = config ('laravel- messenger.users.morph ' , 'participable ' );
494
+ $ morph = config ('messenger.users.morph ' , 'participable ' );
495
495
496
496
return $ this ->participations ()
497
497
->where ("{$ morph }_id " , '= ' , $ participable ->getKey ())
0 commit comments