@@ -268,7 +268,7 @@ |
||
| 268 | 268 | * @param string $groupName The name of the requested group. |
| 269 | 269 | * @param integer $perPage Number of rows per page default 15. |
| 270 | 270 | * @param string $sortBy The name of the column to sort by. |
| 271 | - * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
| 271 | + * @param integer $desc Sort ascending or descinding (1: desc, 0: asc). |
|
| 272 | 272 | * @return \Illuminate\Http\Response |
| 273 | 273 | */ |
| 274 | 274 | public function group(Request $request, $groupName, $perPage = false, $sortBy = 'created_at', $desc = 1) |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * |
| 145 | 145 | * @param array $credentials |
| 146 | 146 | * @param boolean $skipConfirmEmail |
| 147 | - * @return array |
|
| 147 | + * @return boolean |
|
| 148 | 148 | */ |
| 149 | 149 | public function register($credentials, $skipConfirmEmail = false) |
| 150 | 150 | { |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | * Save the given data to the logged in user. |
| 345 | 345 | * |
| 346 | 346 | * @param array $data |
| 347 | - * @return void |
|
| 347 | + * @return boolean |
|
| 348 | 348 | */ |
| 349 | 349 | public function saveProfile($data) |
| 350 | 350 | { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $permissions = []; |
| 29 | 29 | $user = \Core::users()->find(\Auth::id(), $relations); |
| 30 | 30 | foreach ($user->groups()->get() as $group) { |
| 31 | - $group->permissions->each(function ($permission) use (&$permissions) { |
|
| 31 | + $group->permissions->each(function($permission) use (&$permissions) { |
|
| 32 | 32 | $permissions[$permission->model][$permission->id] = $permission->name; |
| 33 | 33 | }); |
| 34 | 34 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $user = $user ?: $this->find(\Auth::id(), ['groups.permissions']); |
| 52 | 52 | $permissions = []; |
| 53 | 53 | |
| 54 | - $user->groups->pluck('permissions')->each(function ($permission) use (&$permissions, $model) { |
|
| 54 | + $user->groups->pluck('permissions')->each(function($permission) use (&$permissions, $model) { |
|
| 55 | 55 | $permissions = array_merge($permissions, $permission->where('model', $model)->pluck('name')->toArray()); |
| 56 | 56 | }); |
| 57 | 57 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function assignGroups($userId, $groupIds) |
| 82 | 82 | { |
| 83 | - \DB::transaction(function () use ($userId, $groupIds) { |
|
| 83 | + \DB::transaction(function() use ($userId, $groupIds) { |
|
| 84 | 84 | $user = $this->find($userId); |
| 85 | 85 | $user->groups()->detach(); |
| 86 | 86 | $user->groups()->attach($groupIds); |
@@ -99,15 +99,15 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function login($credentials, $adminLogin = false) |
| 101 | 101 | { |
| 102 | - if (! $user = $this->first(['email' => $credentials['email']])) { |
|
| 102 | + if ( ! $user = $this->first(['email' => $credentials['email']])) { |
|
| 103 | 103 | \ErrorHandler::loginFailed(); |
| 104 | 104 | } elseif ($adminLogin && ! $user->groups->whereIn('name', ['Admin'])->count()) { |
| 105 | 105 | \ErrorHandler::loginFailed(); |
| 106 | - } elseif (! $adminLogin && $user->groups->whereIn('name', ['Admin'])->count()) { |
|
| 106 | + } elseif ( ! $adminLogin && $user->groups->whereIn('name', ['Admin'])->count()) { |
|
| 107 | 107 | \ErrorHandler::loginFailed(); |
| 108 | 108 | } elseif ($user->blocked) { |
| 109 | 109 | \ErrorHandler::userIsBlocked(); |
| 110 | - } elseif (! config('skeleton.disable_confirm_email') && ! $user->confirmed) { |
|
| 110 | + } elseif ( ! config('skeleton.disable_confirm_email') && ! $user->confirmed) { |
|
| 111 | 111 | \ErrorHandler::emailNotConfirmed(); |
| 112 | 112 | } |
| 113 | 113 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $access_token = $authCode ? Arr::get(\Socialite::driver($type)->getAccessTokenResponse($authCode), 'access_token') : $accessToken; |
| 128 | 128 | $user = \Socialite::driver($type)->userFromToken($access_token); |
| 129 | 129 | |
| 130 | - if (! $user->email) { |
|
| 130 | + if ( ! $user->email) { |
|
| 131 | 131 | \ErrorHandler::noSocialEmail(); |
| 132 | 132 | } |
| 133 | 133 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | if ($skipConfirmEmail) { |
| 154 | 154 | $user->confirmed = 1; |
| 155 | 155 | $user->save(); |
| 156 | - } elseif (! config('skeleton.disable_confirm_email')) { |
|
| 156 | + } elseif ( ! config('skeleton.disable_confirm_email')) { |
|
| 157 | 157 | $this->sendConfirmationEmail($user->email); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -168,10 +168,10 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | public function block($userId) |
| 170 | 170 | { |
| 171 | - if (! $user = $this->find($userId)) { |
|
| 171 | + if ( ! $user = $this->find($userId)) { |
|
| 172 | 172 | \ErrorHandler::notFound('user'); |
| 173 | 173 | } |
| 174 | - if (! $this->hasGroup(['Admin'])) { |
|
| 174 | + if ( ! $this->hasGroup(['Admin'])) { |
|
| 175 | 175 | \ErrorHandler::noPermissions(); |
| 176 | 176 | } elseif (\Auth::id() == $userId) { |
| 177 | 177 | \ErrorHandler::noPermissions(); |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | public function unblock($userId) |
| 195 | 195 | { |
| 196 | - if (! $this->hasGroup(['Admin'])) { |
|
| 196 | + if ( ! $this->hasGroup(['Admin'])) { |
|
| 197 | 197 | \ErrorHandler::noPermissions(); |
| 198 | 198 | } |
| 199 | 199 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | public function sendReset($email) |
| 214 | 214 | { |
| 215 | - if (! $user = $this->model->where('email', $email)->first()) { |
|
| 215 | + if ( ! $user = $this->model->where('email', $email)->first()) { |
|
| 216 | 216 | \ErrorHandler::notFound('email'); |
| 217 | 217 | } |
| 218 | 218 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | */ |
| 229 | 229 | public function resetPassword($credentials) |
| 230 | 230 | { |
| 231 | - $response = \Password::reset($credentials, function ($user, $password) { |
|
| 231 | + $response = \Password::reset($credentials, function($user, $password) { |
|
| 232 | 232 | $user->password = $password; |
| 233 | 233 | $user->save(); |
| 234 | 234 | }); |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | public function changePassword($credentials) |
| 264 | 264 | { |
| 265 | 265 | $user = \Auth::user(); |
| 266 | - if (! \Hash::check($credentials['old_password'], $user->password)) { |
|
| 266 | + if ( ! \Hash::check($credentials['old_password'], $user->password)) { |
|
| 267 | 267 | \ErrorHandler::invalidOldPassword(); |
| 268 | 268 | } |
| 269 | 269 | |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | */ |
| 280 | 280 | public function confirmEmail($confirmationCode) |
| 281 | 281 | { |
| 282 | - if (! $user = $this->first(['confirmation_code' => $confirmationCode])) { |
|
| 282 | + if ( ! $user = $this->first(['confirmation_code' => $confirmationCode])) { |
|
| 283 | 283 | \ErrorHandler::invalidConfirmationCode(); |
| 284 | 284 | } |
| 285 | 285 | |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | $sort = $desc ? 'desc' : 'asc'; |
| 325 | 325 | $model = call_user_func_array("{$this->getModel()}::with", array($relations)); |
| 326 | 326 | |
| 327 | - $model->whereHas('groups', function ($q) use ($groupName) { |
|
| 327 | + $model->whereHas('groups', function($q) use ($groupName) { |
|
| 328 | 328 | $q->where('name', $groupName); |
| 329 | 329 | }); |
| 330 | 330 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * Init new object. |
| 35 | 35 | * |
| 36 | 36 | * @param mixed $repo |
| 37 | - * @param CoreConfig $config |
|
| 37 | + * @param \App\Modules\Core\Utl\CoreConfig $config |
|
| 38 | 38 | * @param string $modelResource |
| 39 | 39 | * @return void |
| 40 | 40 | */ |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * Fetch all records with relations from storage. |
| 60 | 60 | * |
| 61 | 61 | * @param string $sortBy The name of the column to sort by. |
| 62 | - * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
| 62 | + * @param integer $desc Sort ascending or descinding (1: desc, 0: asc). |
|
| 63 | 63 | * @return \Illuminate\Http\Response |
| 64 | 64 | */ |
| 65 | 65 | public function index($sortBy = 'created_at', $desc = 1) |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * @param string $query The search text. |
| 86 | 86 | * @param integer $perPage Number of rows per page default 15. |
| 87 | 87 | * @param string $sortBy The name of the column to sort by. |
| 88 | - * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
| 88 | + * @param integer $desc Sort ascending or descinding (1: desc, 0: asc). |
|
| 89 | 89 | * @return \Illuminate\Http\Response |
| 90 | 90 | */ |
| 91 | 91 | public function search($query = '', $perPage = 15, $sortBy = 'created_at', $desc = 1) |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * |
| 100 | 100 | * @param \Illuminate\Http\Request $request |
| 101 | 101 | * @param string $sortBy The name of the column to sort by. |
| 102 | - * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
| 102 | + * @param integer $desc Sort ascending or descinding (1: desc, 0: asc). |
|
| 103 | 103 | * @return \Illuminate\Http\Response |
| 104 | 104 | */ |
| 105 | 105 | public function findby(Request $request, $sortBy = 'created_at', $desc = 1) |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | * |
| 125 | 125 | * @param integer $perPage Number of rows per page default 15. |
| 126 | 126 | * @param string $sortBy The name of the column to sort by. |
| 127 | - * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
| 127 | + * @param integer $desc Sort ascending or descinding (1: desc, 0: asc). |
|
| 128 | 128 | * @return \Illuminate\Http\Response |
| 129 | 129 | */ |
| 130 | 130 | public function paginate($perPage = 15, $sortBy = 'created_at', $desc = 1) |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * @param \Illuminate\Http\Request $request |
| 140 | 140 | * @param integer $perPage Number of rows per page default 15. |
| 141 | 141 | * @param string $sortBy The name of the column to sort by. |
| 142 | - * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
| 142 | + * @param integer $desc Sort ascending or descinding (1: desc, 0: asc). |
|
| 143 | 143 | * @return \Illuminate\Http\Response |
| 144 | 144 | */ |
| 145 | 145 | public function paginateby(Request $request, $perPage = 15, $sortBy = 'created_at', $desc = 1) |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | * @param \Illuminate\Http\Request $request |
| 190 | 190 | * @param integer $perPage Number of rows per page default 15. |
| 191 | 191 | * @param string $sortBy The name of the column to sort by. |
| 192 | - * @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
|
| 192 | + * @param integer $desc Sort ascending or descinding (1: desc, 0: asc). |
|
| 193 | 193 | * @return \Illuminate\Http\Response |
| 194 | 194 | */ |
| 195 | 195 | public function deleted(Request $request, $perPage = 15, $sortBy = 'created_at', $desc = 1) |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | \Auth::shouldUse('api'); |
| 220 | 220 | $this->middleware('auth:api', ['except' => $this->skipLoginCheck]); |
| 221 | 221 | |
| 222 | - if (! in_array($permission, $this->skipLoginCheck) && $user = \Auth::user()) { |
|
| 222 | + if ( ! in_array($permission, $this->skipLoginCheck) && $user = \Auth::user()) { |
|
| 223 | 223 | $user = \Auth::user(); |
| 224 | 224 | $permission = $permission !== 'index' ? $permission : 'list'; |
| 225 | 225 | $isPasswordClient = $user->token()->client->password_client; |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | if ($isPasswordClient && (in_array($permission, $this->skipPermissionCheck) || \Core::users()->can($permission, $this->modelName))) { |
| 233 | - } elseif (! $isPasswordClient && $user->tokenCan($this->modelName.'-'.$permission)) { |
|
| 233 | + } elseif ( ! $isPasswordClient && $user->tokenCan($this->modelName.'-'.$permission)) { |
|
| 234 | 234 | } else { |
| 235 | 235 | \ErrorHandler::noPermissions(); |
| 236 | 236 | } |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | if ($timezone && $timezone !== $user->timezone) { |
| 303 | 303 | $user->timezone = $timezone; |
| 304 | - $update = true; |
|
| 304 | + $update = true; |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | if ($update) { |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * @param \Illuminate\Http\Request $request |
| 35 | 35 | * @param string $reportName Name of the requested report |
| 36 | 36 | * @param integer $perPage Number of rows per page default all data. |
| 37 | - * @return \Illuminate\Http\Response |
|
| 37 | + * @return \Illuminate\Http\JsonResponse |
|
| 38 | 38 | */ |
| 39 | 39 | public function getReport(Request $request, $reportName, $perPage = 0) |
| 40 | 40 | { |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | return \Response::json(['errors' => [$errors]], $exception->getStatusCode()); |
| 64 | 64 | } elseif ($exception instanceof \Illuminate\Validation\ValidationException) { |
| 65 | 65 | return \Response::json(['errors' => $exception->errors()], 422); |
| 66 | - } elseif (! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) { |
|
| 66 | + } elseif ( ! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) { |
|
| 67 | 67 | return parent::render($request, $exception); |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -11,9 +11,9 @@ discard block |
||
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -Route::group(['prefix' => 'notifications'], function () { |
|
| 14 | +Route::group(['prefix' => 'notifications'], function() { |
|
| 15 | 15 | |
| 16 | - Route::group(['prefix' => 'notifications'], function () { |
|
| 16 | + Route::group(['prefix' => 'notifications'], function() { |
|
| 17 | 17 | |
| 18 | 18 | Route::get('list/{perPage?}', 'NotificationsController@list'); |
| 19 | 19 | Route::get('unread/{perPage?}', 'NotificationsController@unread'); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | Route::get('markAllAsRead', 'NotificationsController@markAllAsRead'); |
| 22 | 22 | }); |
| 23 | 23 | |
| 24 | - Route::group(['prefix' => 'push_notification_devices'], function () { |
|
| 24 | + Route::group(['prefix' => 'push_notification_devices'], function() { |
|
| 25 | 25 | |
| 26 | 26 | Route::get('list/{sortBy?}/{desc?}', 'PushNotificationDevicesController@index'); |
| 27 | 27 | Route::get('find/{id}', 'PushNotificationDevicesController@find'); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('push_notification_devices', function (Blueprint $table) { |
|
| 15 | + Schema::create('push_notification_devices', function(Blueprint $table) { |
|
| 16 | 16 | $table->increments('id'); |
| 17 | 17 | $table->string('device_token'); |
| 18 | 18 | $table->integer('user_id'); |