PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 1.13
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v1.13
2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 1.41 1.45 All 41 releases
fluent-boards / app / Http / Controllers / UserController.php

UserController.php in FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration 1.13, at app/Http/Controllers/UserController.php

105 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentBoards\App\Http\Controllers;
4
5 use FluentBoards\App\Models\Board;
6 use FluentBoards\App\Models\User;
7 use FluentBoards\App\Services\Helper;
8 use FluentBoards\App\Services\UserService;
9 use FluentBoards\Framework\Http\Request\Request;
10
11 class UserController extends Controller
12 {
13 private UserService $userService;
14
15 public function __construct(UserService $userService)
16 {
17 parent::__construct();
18 $this->userService = $userService;
19 }
20
21 public function allFluentBoardsUsers()
22 {
23 return [
24 'users' => $this->userService->allFluentBoardsUsers(),
25 'boards' => Board::select('id', 'title')->orderBy('title', 'ASC')->get()
26 ];
27 }
28
29 public function memberAssociatedTaskUsers($user_id)
30 {
31 try {
32 $uniqueUsers = $this->userService->memberAssociatedTaskUsers($user_id);
33
34 return $this->sendSuccess([
35 'users' => $uniqueUsers['uniqueUsers'],
36 'userWiseBoardDesignation' => $uniqueUsers['userWiseBoardDesignation'],
37 ], 200);
38 } catch (\Exception $e) {
39 return $this->sendError($e->getMessage(), 404);
40 }
41 }
42
43 public function searchFluentBoardsUser(Request $request)
44 {
45 try {
46 $search_input = $request->searchInput . trim('');
47
48 $boardUsers = $this->userService->searchFluentBoardsUser($search_input);
49
50 return $this->sendSuccess($boardUsers, 200);
51 } catch (\Exception $e) {
52 return $this->sendError($e->getMessage(), 404);
53 }
54 }
55
56 public function searchMemberUser(Request $request, $user_id)
57 {
58 try {
59 $search_input = $request->searchInput . trim('');
60 $searchResult = $this->userService->searchMemberUser($search_input, $user_id);
61
62 return $this->sendSuccess([
63 'users' => $searchResult,
64 ], 200);
65 } catch (\Exception $e) {
66 return $this->sendError($e->getMessage(), 404);
67 }
68 }
69
70 public function getMemberAssociatedTasks(Request $request, $user_id)
71 {
72 $page = $request->getSafe('page');
73 try {
74 return $this->sendSuccess(
75 $this->userService->getMemberAssociatedTasks($user_id, $page)
76 , 200);
77 } catch (\Exception $e) {
78 return $this->sendError($e->getMessage(), 404);
79 }
80 }
81
82 public function getMemberRelatedAcitivies(Request $request, $user_id)
83 {
84 $page = $request->getSafe('page');
85 try {
86 return $this->sendSuccess(
87 $this->userService->getMemberRelatedAcitivies($user_id, $page)
88 , 200);
89 } catch (\Exception $e) {
90 return $this->sendError($e->getMessage(), 404);
91 }
92 }
93
94 public function getMemberInfo($user_id)
95 {
96 $user = User::findOrFail($user_id);
97
98 $user = Helper::sanitizeUserCollections($user);
99
100 return [
101 'user' => $user
102 ];
103 }
104 }
105