File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Coderflex \LaravelTicket \Concerns ;
4
4
5
- use Coderflex \LaravelTicket \Models \Message ;
6
- use Coderflex \LaravelTicket \Models \Ticket ;
7
5
use Illuminate \Database \Eloquent \Relations \HasMany ;
8
6
9
7
trait HasTickets
@@ -13,14 +11,22 @@ trait HasTickets
13
11
*/
14
12
public function tickets (): HasMany
15
13
{
16
- return $ this ->hasMany (Ticket::class, 'user_id ' );
14
+ $ model = config (
15
+ 'laravel_ticket.models.ticket ' ,
16
+ parent ::getTable ()
17
+ );
18
+ return $ this ->hasMany ($ model , 'user_id ' );
17
19
}
18
20
19
21
/**
20
22
* Get User tickets relationship
21
23
*/
22
24
public function messages (): HasMany
23
25
{
24
- return $ this ->hasMany (Message::class, 'user_id ' );
26
+ $ model = config (
27
+ 'laravel_ticket.models.message ' ,
28
+ parent ::getTable ()
29
+ );
30
+ return $ this ->hasMany ($ model , 'user_id ' );
25
31
}
26
32
}
You can’t perform that action at this time.
0 commit comments