File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 22
33namespace Coderflex \LaravelTicket \Concerns ;
44
5- use Coderflex \LaravelTicket \Models \Message ;
6- use Coderflex \LaravelTicket \Models \Ticket ;
75use Illuminate \Database \Eloquent \Relations \HasMany ;
86
97trait HasTickets
@@ -13,14 +11,22 @@ trait HasTickets
1311 */
1412 public function tickets (): HasMany
1513 {
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 ' );
1719 }
1820
1921 /**
2022 * Get User tickets relationship
2123 */
2224 public function messages (): HasMany
2325 {
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 ' );
2531 }
2632}
You can’t perform that action at this time.
0 commit comments