@@ -6,38 +6,38 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ApiSkeletonServiceProvider extends ServiceProvider |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Perform post-registration booting of services. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function boot() |
|
| 15 | - { |
|
| 16 | - $this->publishes([ |
|
| 17 | - __DIR__.'/Modules' => app_path('Modules'), |
|
| 18 | - __DIR__.'/Modules/Core/Resources/Assets' => base_path('public/doc/assets'), |
|
| 19 | - __DIR__.'/../lang' => base_path('resources/lang'), |
|
| 20 | - __DIR__.'/../files/Handler.php' => app_path('Exceptions/Handler.php'), |
|
| 21 | - __DIR__.'/../files/AuthServiceProvider.php' => app_path('Providers/AuthServiceProvider.php'), |
|
| 22 | - __DIR__.'/../files/BroadcastServiceProvider.php' => app_path('Providers/BroadcastServiceProvider.php'), |
|
| 23 | - __DIR__.'/../files/Kernel.php' => app_path('Console/Kernel.php'), |
|
| 24 | - ]); |
|
| 9 | + /** |
|
| 10 | + * Perform post-registration booting of services. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function boot() |
|
| 15 | + { |
|
| 16 | + $this->publishes([ |
|
| 17 | + __DIR__.'/Modules' => app_path('Modules'), |
|
| 18 | + __DIR__.'/Modules/Core/Resources/Assets' => base_path('public/doc/assets'), |
|
| 19 | + __DIR__.'/../lang' => base_path('resources/lang'), |
|
| 20 | + __DIR__.'/../files/Handler.php' => app_path('Exceptions/Handler.php'), |
|
| 21 | + __DIR__.'/../files/AuthServiceProvider.php' => app_path('Providers/AuthServiceProvider.php'), |
|
| 22 | + __DIR__.'/../files/BroadcastServiceProvider.php' => app_path('Providers/BroadcastServiceProvider.php'), |
|
| 23 | + __DIR__.'/../files/Kernel.php' => app_path('Console/Kernel.php'), |
|
| 24 | + ]); |
|
| 25 | 25 | |
| 26 | - $this->publishes([ |
|
| 27 | - __DIR__.'/../config/skeleton.php' => config_path('skeleton.php'), |
|
| 28 | - __DIR__.'/../files/auth.php' => config_path('auth.php'), |
|
| 29 | - ], 'config'); |
|
| 30 | - } |
|
| 26 | + $this->publishes([ |
|
| 27 | + __DIR__.'/../config/skeleton.php' => config_path('skeleton.php'), |
|
| 28 | + __DIR__.'/../files/auth.php' => config_path('auth.php'), |
|
| 29 | + ], 'config'); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * Register any package services. |
|
| 34 | - * |
|
| 35 | - * @return void |
|
| 36 | - */ |
|
| 37 | - public function register() |
|
| 38 | - { |
|
| 39 | - $this->mergeConfigFrom( |
|
| 40 | - __DIR__.'/../config/skeleton.php', 'skeleton' |
|
| 41 | - ); |
|
| 42 | - } |
|
| 32 | + /** |
|
| 33 | + * Register any package services. |
|
| 34 | + * |
|
| 35 | + * @return void |
|
| 36 | + */ |
|
| 37 | + public function register() |
|
| 38 | + { |
|
| 39 | + $this->mergeConfigFrom( |
|
| 40 | + __DIR__.'/../config/skeleton.php', 'skeleton' |
|
| 41 | + ); |
|
| 42 | + } |
|
| 43 | 43 | } |
| 44 | 44 | \ No newline at end of file |
@@ -2,117 +2,117 @@ |
||
| 2 | 2 | |
| 3 | 3 | class ErrorHandler |
| 4 | 4 | { |
| 5 | - public function unAuthorized() |
|
| 6 | - { |
|
| 7 | - $error = ['status' => 401, 'message' => trans('core::errors.unAuthorized')]; |
|
| 8 | - abort($error['status'], $error['message']); |
|
| 9 | - } |
|
| 10 | - |
|
| 11 | - public function invalidRefreshToken() |
|
| 12 | - { |
|
| 13 | - $error = ['status' => 400, 'message' => trans('core::errors.invalidRefreshToken')]; |
|
| 14 | - abort($error['status'], $error['message']); |
|
| 15 | - } |
|
| 16 | - |
|
| 17 | - public function noPermissions() |
|
| 18 | - { |
|
| 19 | - $error = ['status' => 403, 'message' => trans('core::errors.noPermissions')]; |
|
| 20 | - abort($error['status'], $error['message']); |
|
| 21 | - } |
|
| 22 | - |
|
| 23 | - public function loginFailed() |
|
| 24 | - { |
|
| 25 | - $error = ['status' => 400, 'message' => trans('core::errors.loginFailed')]; |
|
| 26 | - abort($error['status'], $error['message']); |
|
| 27 | - } |
|
| 28 | - |
|
| 29 | - public function noSocialEmail() |
|
| 30 | - { |
|
| 31 | - $error = ['status' => 400, 'message' => trans('core::errors.noSocialEmail')]; |
|
| 32 | - abort($error['status'], $error['message']); |
|
| 33 | - } |
|
| 34 | - |
|
| 35 | - public function userAlreadyRegistered() |
|
| 36 | - { |
|
| 37 | - $error = ['status' => 400, 'message' => trans('core::errors.userAlreadyRegistered')]; |
|
| 38 | - abort($error['status'], $error['message']); |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - public function connectionError() |
|
| 42 | - { |
|
| 43 | - $error = ['status' => 400, 'message' => trans('core::errors.connectionError')]; |
|
| 44 | - abort($error['status'], $error['message']); |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - public function redisNotRunning() |
|
| 48 | - { |
|
| 49 | - $error = ['status' => 400, 'message' => trans('core::errors.redisNotRunning')]; |
|
| 50 | - abort($error['status'], $error['message']); |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - public function dbQueryError() |
|
| 54 | - { |
|
| 55 | - $error = ['status' => 400, 'message' => trans('core::errors.dbQueryError')]; |
|
| 56 | - abort($error['status'], $error['message']); |
|
| 57 | - } |
|
| 58 | - |
|
| 59 | - public function cannotCreateSetting() |
|
| 60 | - { |
|
| 61 | - $error = ['status' => 400, 'message' => trans('core::errors.cannotCreateSetting')]; |
|
| 62 | - abort($error['status'], $error['message']); |
|
| 63 | - } |
|
| 64 | - |
|
| 65 | - public function cannotUpdateSettingKey() |
|
| 66 | - { |
|
| 67 | - $error = ['status' => 400, 'message' => trans('core::errors.cannotUpdateSettingKey')]; |
|
| 68 | - abort($error['status'], $error['message']); |
|
| 69 | - } |
|
| 70 | - |
|
| 71 | - public function userIsBlocked() |
|
| 72 | - { |
|
| 73 | - $error = ['status' => 403, 'message' => trans('core::errors.userIsBlocked')]; |
|
| 74 | - abort($error['status'], $error['message']); |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - public function emailNotConfirmed() |
|
| 78 | - { |
|
| 79 | - $error = ['status' => 403, 'message' => trans('core::errors.emailNotConfirmed')]; |
|
| 80 | - abort($error['status'], $error['message']); |
|
| 81 | - } |
|
| 82 | - |
|
| 83 | - public function emailAlreadyConfirmed() |
|
| 84 | - { |
|
| 85 | - $error = ['status' => 403, 'message' => trans('core::errors.emailAlreadyConfirmed')]; |
|
| 86 | - abort($error['status'], $error['message']); |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - public function invalidResetToken() |
|
| 90 | - { |
|
| 91 | - $error = ['status' => 400, 'message' => trans('core::errors.invalidResetToken')]; |
|
| 92 | - abort($error['status'], $error['message']); |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - public function invalidResetPassword() |
|
| 96 | - { |
|
| 97 | - $error = ['status' => 400, 'message' => trans('core::errors.invalidResetPassword')]; |
|
| 98 | - abort($error['status'], $error['message']); |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - public function invalidOldPassword() |
|
| 102 | - { |
|
| 103 | - $error = ['status' => 400, 'message' => trans('core::errors.invalidOldPassword')]; |
|
| 104 | - abort($error['status'], $error['message']); |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - public function notFound($text) |
|
| 108 | - { |
|
| 109 | - $error = ['status' => 404, 'message' => trans('core::errors.notFound', ['replace' => $text])]; |
|
| 110 | - abort($error['status'], $error['message']); |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - public function generalError() |
|
| 114 | - { |
|
| 115 | - $error = ['status' => 400, 'message' => trans('core::errors.generalError')]; |
|
| 116 | - abort($error['status'], $error['message']); |
|
| 117 | - } |
|
| 5 | + public function unAuthorized() |
|
| 6 | + { |
|
| 7 | + $error = ['status' => 401, 'message' => trans('core::errors.unAuthorized')]; |
|
| 8 | + abort($error['status'], $error['message']); |
|
| 9 | + } |
|
| 10 | + |
|
| 11 | + public function invalidRefreshToken() |
|
| 12 | + { |
|
| 13 | + $error = ['status' => 400, 'message' => trans('core::errors.invalidRefreshToken')]; |
|
| 14 | + abort($error['status'], $error['message']); |
|
| 15 | + } |
|
| 16 | + |
|
| 17 | + public function noPermissions() |
|
| 18 | + { |
|
| 19 | + $error = ['status' => 403, 'message' => trans('core::errors.noPermissions')]; |
|
| 20 | + abort($error['status'], $error['message']); |
|
| 21 | + } |
|
| 22 | + |
|
| 23 | + public function loginFailed() |
|
| 24 | + { |
|
| 25 | + $error = ['status' => 400, 'message' => trans('core::errors.loginFailed')]; |
|
| 26 | + abort($error['status'], $error['message']); |
|
| 27 | + } |
|
| 28 | + |
|
| 29 | + public function noSocialEmail() |
|
| 30 | + { |
|
| 31 | + $error = ['status' => 400, 'message' => trans('core::errors.noSocialEmail')]; |
|
| 32 | + abort($error['status'], $error['message']); |
|
| 33 | + } |
|
| 34 | + |
|
| 35 | + public function userAlreadyRegistered() |
|
| 36 | + { |
|
| 37 | + $error = ['status' => 400, 'message' => trans('core::errors.userAlreadyRegistered')]; |
|
| 38 | + abort($error['status'], $error['message']); |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + public function connectionError() |
|
| 42 | + { |
|
| 43 | + $error = ['status' => 400, 'message' => trans('core::errors.connectionError')]; |
|
| 44 | + abort($error['status'], $error['message']); |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + public function redisNotRunning() |
|
| 48 | + { |
|
| 49 | + $error = ['status' => 400, 'message' => trans('core::errors.redisNotRunning')]; |
|
| 50 | + abort($error['status'], $error['message']); |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + public function dbQueryError() |
|
| 54 | + { |
|
| 55 | + $error = ['status' => 400, 'message' => trans('core::errors.dbQueryError')]; |
|
| 56 | + abort($error['status'], $error['message']); |
|
| 57 | + } |
|
| 58 | + |
|
| 59 | + public function cannotCreateSetting() |
|
| 60 | + { |
|
| 61 | + $error = ['status' => 400, 'message' => trans('core::errors.cannotCreateSetting')]; |
|
| 62 | + abort($error['status'], $error['message']); |
|
| 63 | + } |
|
| 64 | + |
|
| 65 | + public function cannotUpdateSettingKey() |
|
| 66 | + { |
|
| 67 | + $error = ['status' => 400, 'message' => trans('core::errors.cannotUpdateSettingKey')]; |
|
| 68 | + abort($error['status'], $error['message']); |
|
| 69 | + } |
|
| 70 | + |
|
| 71 | + public function userIsBlocked() |
|
| 72 | + { |
|
| 73 | + $error = ['status' => 403, 'message' => trans('core::errors.userIsBlocked')]; |
|
| 74 | + abort($error['status'], $error['message']); |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + public function emailNotConfirmed() |
|
| 78 | + { |
|
| 79 | + $error = ['status' => 403, 'message' => trans('core::errors.emailNotConfirmed')]; |
|
| 80 | + abort($error['status'], $error['message']); |
|
| 81 | + } |
|
| 82 | + |
|
| 83 | + public function emailAlreadyConfirmed() |
|
| 84 | + { |
|
| 85 | + $error = ['status' => 403, 'message' => trans('core::errors.emailAlreadyConfirmed')]; |
|
| 86 | + abort($error['status'], $error['message']); |
|
| 87 | + } |
|
| 88 | + |
|
| 89 | + public function invalidResetToken() |
|
| 90 | + { |
|
| 91 | + $error = ['status' => 400, 'message' => trans('core::errors.invalidResetToken')]; |
|
| 92 | + abort($error['status'], $error['message']); |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + public function invalidResetPassword() |
|
| 96 | + { |
|
| 97 | + $error = ['status' => 400, 'message' => trans('core::errors.invalidResetPassword')]; |
|
| 98 | + abort($error['status'], $error['message']); |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + public function invalidOldPassword() |
|
| 102 | + { |
|
| 103 | + $error = ['status' => 400, 'message' => trans('core::errors.invalidOldPassword')]; |
|
| 104 | + abort($error['status'], $error['message']); |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + public function notFound($text) |
|
| 108 | + { |
|
| 109 | + $error = ['status' => 404, 'message' => trans('core::errors.notFound', ['replace' => $text])]; |
|
| 110 | + abort($error['status'], $error['message']); |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + public function generalError() |
|
| 114 | + { |
|
| 115 | + $error = ['status' => 400, 'message' => trans('core::errors.generalError')]; |
|
| 116 | + abort($error['status'], $error['message']); |
|
| 117 | + } |
|
| 118 | 118 | } |
| 119 | 119 | \ No newline at end of file |