@@ -64,7 +64,7 @@ |
||
64 | 64 | /** |
65 | 65 | * Get columns. |
66 | 66 | * |
67 | - * @return array |
|
67 | + * @return string[] |
|
68 | 68 | */ |
69 | 69 | protected function getColumns() |
70 | 70 | { |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | ->addColumn('action', 'user.action') |
20 | 20 | ->editColumn('role', function(User $user) { |
21 | 21 | $role_en = array(0 => "Registered", 1 => "User", 2 => "Manager", 3 => "Admin"); |
22 | - return $role_en[$user->role].' ('.$user->role.')';}) |
|
23 | - ->setRowClass(function ($user) { |
|
22 | + return $role_en[ $user->role ].' ('.$user->role.')'; }) |
|
23 | + ->setRowClass(function($user) { |
|
24 | 24 | return $user->trashed() ? 'alert-danger' : ""; |
25 | 25 | }); |
26 | 26 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | //->addAction(['width' => '160px']) |
51 | 51 | ->parameters([ |
52 | 52 | 'dom' => 'Bfrtip', |
53 | - 'order' => [[0, 'asc']], |
|
53 | + 'order' => [ [ 0, 'asc' ] ], |
|
54 | 54 | 'buttons' => [ |
55 | 55 | 'create', |
56 | 56 | 'export', |
@@ -87,6 +87,6 @@ discard block |
||
87 | 87 | */ |
88 | 88 | protected function filename() |
89 | 89 | { |
90 | - return 'users_' . time(); |
|
90 | + return 'users_'.time(); |
|
91 | 91 | } |
92 | 92 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * Store a new user. |
50 | 50 | * |
51 | 51 | * @param Request $request |
52 | - * @return Response |
|
52 | + * @return \Illuminate\Http\RedirectResponse |
|
53 | 53 | */ |
54 | 54 | public function store(Request $request) |
55 | 55 | { |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @param Request $request |
115 | 115 | * @param string $id |
116 | - * @return Response |
|
116 | + * @return \Illuminate\Http\RedirectResponse |
|
117 | 117 | */ |
118 | 118 | public function update(Request $request, $id) |
119 | 119 | { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * |
151 | 151 | * @param Request $request |
152 | 152 | * @param string $id |
153 | - * @return Response |
|
153 | + * @return \Illuminate\Http\RedirectResponse |
|
154 | 154 | */ |
155 | 155 | public function destroy(Request $request, $id) |
156 | 156 | { |
@@ -6,8 +6,6 @@ |
||
6 | 6 | use Illuminate\Http\Request; |
7 | 7 | use App\Http\Controllers\Controller; |
8 | 8 | use App\DataTables\UsersDataTable; |
9 | -use Illuminate\Support\Facades\Auth; |
|
10 | -use Illuminate\Validation\Rule; |
|
11 | 9 | use App\User; |
12 | 10 | |
13 | 11 | class UserController extends Controller |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $user = User::findOrFail($id); |
91 | 91 | $user->password = ""; |
92 | 92 | |
93 | - return view('user.show', ['user' => $user]); |
|
93 | + return view('user.show', [ 'user' => $user ]); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $user = User::findOrFail($id); |
106 | 106 | $user->password = ""; |
107 | 107 | |
108 | - return view('user.edit', ['user' => $user]); |
|
108 | + return view('user.edit', [ 'user' => $user ]); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -179,6 +179,6 @@ discard block |
||
179 | 179 | $user = User::findOrFail($id); |
180 | 180 | $user->password = ""; |
181 | 181 | |
182 | - return view('user.remove', ['user' => $user]); |
|
182 | + return view('user.remove', [ 'user' => $user ]); |
|
183 | 183 | } |
184 | 184 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @param \App\User $user |
31 | 31 | * @param \App\User $user |
32 | - * @return mixed |
|
32 | + * @return boolean |
|
33 | 33 | */ |
34 | 34 | public function view(User $user, User $user2) |
35 | 35 | { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * Determine whether the user can create users. |
42 | 42 | * |
43 | 43 | * @param \App\User $user |
44 | - * @return mixed |
|
44 | + * @return boolean |
|
45 | 45 | */ |
46 | 46 | public function create(User $user) |
47 | 47 | { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @param \App\User $user |
56 | 56 | * @param \App\User $user |
57 | - * @return mixed |
|
57 | + * @return boolean |
|
58 | 58 | */ |
59 | 59 | public function update(User $user, User $user) |
60 | 60 | { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @param \App\User $user |
70 | 70 | * @param \App\User $user |
71 | - * @return mixed |
|
71 | + * @return boolean |
|
72 | 72 | */ |
73 | 73 | public function delete(User $user, User $user) |
74 | 74 | { |
@@ -29,7 +29,7 @@ |
||
29 | 29 | }); |
30 | 30 | |
31 | 31 | Validator::replacer('phone', function($message, $attribute, $rule, $parameters) { |
32 | - return str_replace(':attribute',$attribute, ':attribute is invalid phone number'); |
|
32 | + return str_replace(':attribute', $attribute, ':attribute is invalid phone number'); |
|
33 | 33 | }); |
34 | 34 | } |
35 | 35 |