File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ class User extends Authenticatable
2323 'name ' ,
2424 'email ' ,
2525 'password ' ,
26- 'role '
26+ 'role ' ,
27+ 'is_online '
2728 ];
2829
2930 /**
@@ -48,4 +49,19 @@ protected function casts(): array
4849 'password ' => 'hashed ' ,
4950 ];
5051 }
52+ public function chats (): \Illuminate \Database \Eloquent \Relations \HasMany
53+ {
54+ return $ this ->hasMany (Chat::class, 'user_id ' );
55+ }
56+
57+ public function agentChats (): \Illuminate \Database \Eloquent \Relations \HasMany
58+ {
59+ return $ this ->hasMany (Chat::class, 'agent_id ' );
60+ }
61+
62+ public function messages (): \Illuminate \Database \Eloquent \Relations \HasMany
63+ {
64+ return $ this ->hasMany (Message::class, 'sender_id ' );
65+ }
66+
5167}
Original file line number Diff line number Diff line change 4343Route::prefix ('user ' )->
4444 middleware ('auth:sanctum ' )
4545 ->group (function () {
46- Route::get ('/chats ' , [ChatController::class, 'getUserChats ' ]);
46+ // Route::get('/chats', [ChatController::class, 'getUserChats']);
4747 Route::get ('/profile ' , [AuthController::class, 'user ' ]);
48- Route::patch ('/profile ' , [AuthController::class, 'updateProfile ' ]);
48+ // Route::patch('/profile', [AuthController::class, 'updateProfile']);
4949 });
5050
5151// Health Check Route
You can’t perform that action at this time.
0 commit comments