@@ -2,14 +2,14 @@ |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - /** |
|
| 6 | - * Here goes your error messages. |
|
| 7 | - */ |
|
| 8 | - 'connectionError' => 'خطأ في الاتصال', |
|
| 9 | - 'redisNotRunning' => 'سيرفير الاشعارات لايعمل', |
|
| 10 | - 'dbQueryError' => 'خطا في البيانات', |
|
| 11 | - 'cannotCreateSetting' => 'لا يمكن اضافة اعدادات', |
|
| 12 | - 'cannotUpdateSettingKey' => 'لا يمكن تعديل اعدادات', |
|
| 13 | - 'notFound' => 'ال :replace المطلوب غير موجود' |
|
| 5 | + /** |
|
| 6 | + * Here goes your error messages. |
|
| 7 | + */ |
|
| 8 | + 'connectionError' => 'خطأ في الاتصال', |
|
| 9 | + 'redisNotRunning' => 'سيرفير الاشعارات لايعمل', |
|
| 10 | + 'dbQueryError' => 'خطا في البيانات', |
|
| 11 | + 'cannotCreateSetting' => 'لا يمكن اضافة اعدادات', |
|
| 12 | + 'cannotUpdateSettingKey' => 'لا يمكن تعديل اعدادات', |
|
| 13 | + 'notFound' => 'ال :replace المطلوب غير موجود' |
|
| 14 | 14 | |
| 15 | 15 | ]; |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | class Errors extends Facade |
| 6 | 6 | { |
| 7 | - protected static function getFacadeAccessor() |
|
| 8 | - { |
|
| 9 | - return 'Errors'; |
|
| 10 | - } |
|
| 7 | + protected static function getFacadeAccessor() |
|
| 8 | + { |
|
| 9 | + return 'Errors'; |
|
| 10 | + } |
|
| 11 | 11 | } |
@@ -4,33 +4,33 @@ |
||
| 4 | 4 | |
| 5 | 5 | class CoreErrors |
| 6 | 6 | { |
| 7 | - public function connectionError() |
|
| 8 | - { |
|
| 9 | - abort(500, trans('core::errors.connectionError')); |
|
| 10 | - } |
|
| 7 | + public function connectionError() |
|
| 8 | + { |
|
| 9 | + abort(500, trans('core::errors.connectionError')); |
|
| 10 | + } |
|
| 11 | 11 | |
| 12 | - public function redisNotRunning() |
|
| 13 | - { |
|
| 14 | - abort(500, trans('core::errors.redisNotRunning')); |
|
| 15 | - } |
|
| 12 | + public function redisNotRunning() |
|
| 13 | + { |
|
| 14 | + abort(500, trans('core::errors.redisNotRunning')); |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - public function dbQueryError() |
|
| 18 | - { |
|
| 19 | - abort(500, trans('core::errors.dbQueryError')); |
|
| 20 | - } |
|
| 17 | + public function dbQueryError() |
|
| 18 | + { |
|
| 19 | + abort(500, trans('core::errors.dbQueryError')); |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - public function cannotCreateSetting() |
|
| 23 | - { |
|
| 24 | - abort(400, trans('core::errors.cannotCreateSetting')); |
|
| 25 | - } |
|
| 22 | + public function cannotCreateSetting() |
|
| 23 | + { |
|
| 24 | + abort(400, trans('core::errors.cannotCreateSetting')); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - public function cannotUpdateSettingKey() |
|
| 28 | - { |
|
| 29 | - abort(400, trans('core::errors.cannotUpdateSettingKey')); |
|
| 30 | - } |
|
| 27 | + public function cannotUpdateSettingKey() |
|
| 28 | + { |
|
| 29 | + abort(400, trans('core::errors.cannotUpdateSettingKey')); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - public function notFound($text) |
|
| 33 | - { |
|
| 34 | - abort(404, trans('core::errors.notFound', ['replace' => $text])); |
|
| 35 | - } |
|
| 32 | + public function notFound($text) |
|
| 33 | + { |
|
| 34 | + abort(404, trans('core::errors.notFound', ['replace' => $text])); |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -19,8 +19,8 @@ |
||
| 19 | 19 | public function __call($name, $arguments) |
| 20 | 20 | { |
| 21 | 21 | foreach (\Module::all() as $module) { |
| 22 | - $nameSpace = 'App\\Modules\\' . $module['basename']; |
|
| 23 | - $class = $nameSpace . '\\Errors\\' . $module['basename'] . 'Errors'; |
|
| 22 | + $nameSpace = 'App\\Modules\\'.$module['basename']; |
|
| 23 | + $class = $nameSpace.'\\Errors\\'.$module['basename'].'Errors'; |
|
| 24 | 24 | |
| 25 | 25 | if (class_exists($class)) { |
| 26 | 26 | $class = \App::make($class); |
@@ -6,28 +6,28 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Errors implements BaseFactoryInterface |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Construct the config class name based on |
|
| 11 | - * the method name called, search in the |
|
| 12 | - * given namespaces for the class and |
|
| 13 | - * return an instance. |
|
| 14 | - * |
|
| 15 | - * @param string $name the called method name |
|
| 16 | - * @param array $arguments the method arguments |
|
| 17 | - * @return object |
|
| 18 | - */ |
|
| 19 | - public function __call($name, $arguments) |
|
| 20 | - { |
|
| 21 | - foreach (\Module::all() as $module) { |
|
| 22 | - $nameSpace = 'App\\Modules\\' . $module['basename']; |
|
| 23 | - $class = $nameSpace . '\\Errors\\' . $module['basename'] . 'Errors'; |
|
| 9 | + /** |
|
| 10 | + * Construct the config class name based on |
|
| 11 | + * the method name called, search in the |
|
| 12 | + * given namespaces for the class and |
|
| 13 | + * return an instance. |
|
| 14 | + * |
|
| 15 | + * @param string $name the called method name |
|
| 16 | + * @param array $arguments the method arguments |
|
| 17 | + * @return object |
|
| 18 | + */ |
|
| 19 | + public function __call($name, $arguments) |
|
| 20 | + { |
|
| 21 | + foreach (\Module::all() as $module) { |
|
| 22 | + $nameSpace = 'App\\Modules\\' . $module['basename']; |
|
| 23 | + $class = $nameSpace . '\\Errors\\' . $module['basename'] . 'Errors'; |
|
| 24 | 24 | |
| 25 | - if (class_exists($class)) { |
|
| 26 | - $class = \App::make($class); |
|
| 27 | - if (method_exists($class, $name)) { |
|
| 28 | - return call_user_func_array([$class, $name], $arguments); |
|
| 29 | - } |
|
| 30 | - } |
|
| 31 | - } |
|
| 32 | - } |
|
| 25 | + if (class_exists($class)) { |
|
| 26 | + $class = \App::make($class); |
|
| 27 | + if (method_exists($class, $name)) { |
|
| 28 | + return call_user_func_array([$class, $name], $arguments); |
|
| 29 | + } |
|
| 30 | + } |
|
| 31 | + } |
|
| 32 | + } |
|
| 33 | 33 | } |
@@ -7,69 +7,69 @@ |
||
| 7 | 7 | */ |
| 8 | 8 | class RoleObserver |
| 9 | 9 | { |
| 10 | - public function saving($model) |
|
| 11 | - { |
|
| 12 | - // |
|
| 13 | - } |
|
| 10 | + public function saving($model) |
|
| 11 | + { |
|
| 12 | + // |
|
| 13 | + } |
|
| 14 | 14 | |
| 15 | - public function saved($model) |
|
| 16 | - { |
|
| 17 | - // |
|
| 18 | - } |
|
| 15 | + public function saved($model) |
|
| 16 | + { |
|
| 17 | + // |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - public function creating($model) |
|
| 21 | - { |
|
| 22 | - // |
|
| 23 | - } |
|
| 20 | + public function creating($model) |
|
| 21 | + { |
|
| 22 | + // |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function created($model) |
|
| 26 | - { |
|
| 27 | - // |
|
| 28 | - } |
|
| 25 | + public function created($model) |
|
| 26 | + { |
|
| 27 | + // |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Prevent updating of the admin role. |
|
| 32 | - * |
|
| 33 | - * @param object $model the model beign updated. |
|
| 34 | - * @return void |
|
| 35 | - */ |
|
| 36 | - public function updating($model) |
|
| 37 | - { |
|
| 38 | - if ($model->getOriginal('name') == 'Admin') { |
|
| 39 | - \Errors::noPermissions(); |
|
| 40 | - } |
|
| 41 | - } |
|
| 30 | + /** |
|
| 31 | + * Prevent updating of the admin role. |
|
| 32 | + * |
|
| 33 | + * @param object $model the model beign updated. |
|
| 34 | + * @return void |
|
| 35 | + */ |
|
| 36 | + public function updating($model) |
|
| 37 | + { |
|
| 38 | + if ($model->getOriginal('name') == 'Admin') { |
|
| 39 | + \Errors::noPermissions(); |
|
| 40 | + } |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - public function updated($model) |
|
| 44 | - { |
|
| 45 | - // |
|
| 46 | - } |
|
| 43 | + public function updated($model) |
|
| 44 | + { |
|
| 45 | + // |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * Prevent deleting the admin role. |
|
| 50 | - * |
|
| 51 | - * @param object $model the delted model. |
|
| 52 | - * @return void |
|
| 53 | - */ |
|
| 54 | - public function deleting($model) |
|
| 55 | - { |
|
| 56 | - if ($model->getOriginal('name') == 'Admin') { |
|
| 57 | - \Errors::noPermissions(); |
|
| 58 | - } |
|
| 59 | - } |
|
| 48 | + /** |
|
| 49 | + * Prevent deleting the admin role. |
|
| 50 | + * |
|
| 51 | + * @param object $model the delted model. |
|
| 52 | + * @return void |
|
| 53 | + */ |
|
| 54 | + public function deleting($model) |
|
| 55 | + { |
|
| 56 | + if ($model->getOriginal('name') == 'Admin') { |
|
| 57 | + \Errors::noPermissions(); |
|
| 58 | + } |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - public function deleted($model) |
|
| 62 | - { |
|
| 63 | - // |
|
| 64 | - } |
|
| 61 | + public function deleted($model) |
|
| 62 | + { |
|
| 63 | + // |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - public function restoring($model) |
|
| 67 | - { |
|
| 68 | - // |
|
| 69 | - } |
|
| 66 | + public function restoring($model) |
|
| 67 | + { |
|
| 68 | + // |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - public function restored($model) |
|
| 72 | - { |
|
| 73 | - // |
|
| 74 | - } |
|
| 71 | + public function restored($model) |
|
| 72 | + { |
|
| 73 | + // |
|
| 74 | + } |
|
| 75 | 75 | } |
@@ -2,21 +2,21 @@ |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - /** |
|
| 6 | - * Here goes your error messages. |
|
| 7 | - */ |
|
| 8 | - 'unAuthorized' => 'Please login before any action', |
|
| 9 | - 'invalidRefreshToken' => 'Invalid refresh token', |
|
| 10 | - 'noPermissions' => 'No permissions', |
|
| 11 | - 'loginFailed' => 'Wrong mail or password', |
|
| 12 | - 'noSocialEmail' => 'Couldn\'t retrieve email', |
|
| 13 | - 'userAlreadyRegistered' => 'User already registered. Please login using email and password', |
|
| 14 | - 'userIsBlocked' => 'You have been blocked', |
|
| 15 | - 'invalidResetToken' => 'Reset password token is invalid', |
|
| 16 | - 'invalidResetPassword' => 'Reset password is invalid', |
|
| 17 | - 'invalidOldPassword' => 'Old password is invalid', |
|
| 18 | - 'invalidConfirmationCode' => 'Confirmation link expired or already used', |
|
| 19 | - 'emailNotConfirmed' => 'Your email isn\'t confirmed', |
|
| 20 | - 'emailAlreadyConfirmed' => 'Your email is already confirmed' |
|
| 5 | + /** |
|
| 6 | + * Here goes your error messages. |
|
| 7 | + */ |
|
| 8 | + 'unAuthorized' => 'Please login before any action', |
|
| 9 | + 'invalidRefreshToken' => 'Invalid refresh token', |
|
| 10 | + 'noPermissions' => 'No permissions', |
|
| 11 | + 'loginFailed' => 'Wrong mail or password', |
|
| 12 | + 'noSocialEmail' => 'Couldn\'t retrieve email', |
|
| 13 | + 'userAlreadyRegistered' => 'User already registered. Please login using email and password', |
|
| 14 | + 'userIsBlocked' => 'You have been blocked', |
|
| 15 | + 'invalidResetToken' => 'Reset password token is invalid', |
|
| 16 | + 'invalidResetPassword' => 'Reset password is invalid', |
|
| 17 | + 'invalidOldPassword' => 'Old password is invalid', |
|
| 18 | + 'invalidConfirmationCode' => 'Confirmation link expired or already used', |
|
| 19 | + 'emailNotConfirmed' => 'Your email isn\'t confirmed', |
|
| 20 | + 'emailAlreadyConfirmed' => 'Your email is already confirmed' |
|
| 21 | 21 | |
| 22 | 22 | ]; |
@@ -2,21 +2,21 @@ |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - /** |
|
| 6 | - * Here goes your error messages. |
|
| 7 | - */ |
|
| 8 | - 'unAuthorized' => 'من فضلك قم بتسجيل الدخول', |
|
| 9 | - 'invalidRefreshToken' => 'رمز التحديث غير صالح', |
|
| 10 | - 'noPermissions' => 'لا توجد صلاحية', |
|
| 11 | - 'loginFailed' => 'خطأ في البريد لاكتروني او كلمة المرور', |
|
| 12 | - 'noSocialEmail' => 'لا يمكن الحصول علي تابريد الاكتروني', |
|
| 13 | - 'userAlreadyRegistered' => 'المستخد مسجل بالفعل.سجل الدخول بالبريد الاكتروني و كلمة السر', |
|
| 14 | - 'userIsBlocked' => 'لقد تم حظرك', |
|
| 15 | - 'invalidResetToken' => 'رمز تعديل كلمة المرور خطا', |
|
| 16 | - 'invalidResetPassword' => 'خطا في نعديل كلمة المرور', |
|
| 17 | - 'invalidOldPassword' => 'كلمة السر القديمه خطا', |
|
| 18 | - 'invalidConfirmationCode' => 'لينك التاكيد غير صالح اة مستخدم من قبل', |
|
| 19 | - 'emailNotConfirmed' => 'بريدك الاكتروني غير مفعل', |
|
| 20 | - 'emailAlreadyConfirmed' => 'البريد الاكتروني مفع بالقعل' |
|
| 5 | + /** |
|
| 6 | + * Here goes your error messages. |
|
| 7 | + */ |
|
| 8 | + 'unAuthorized' => 'من فضلك قم بتسجيل الدخول', |
|
| 9 | + 'invalidRefreshToken' => 'رمز التحديث غير صالح', |
|
| 10 | + 'noPermissions' => 'لا توجد صلاحية', |
|
| 11 | + 'loginFailed' => 'خطأ في البريد لاكتروني او كلمة المرور', |
|
| 12 | + 'noSocialEmail' => 'لا يمكن الحصول علي تابريد الاكتروني', |
|
| 13 | + 'userAlreadyRegistered' => 'المستخد مسجل بالفعل.سجل الدخول بالبريد الاكتروني و كلمة السر', |
|
| 14 | + 'userIsBlocked' => 'لقد تم حظرك', |
|
| 15 | + 'invalidResetToken' => 'رمز تعديل كلمة المرور خطا', |
|
| 16 | + 'invalidResetPassword' => 'خطا في نعديل كلمة المرور', |
|
| 17 | + 'invalidOldPassword' => 'كلمة السر القديمه خطا', |
|
| 18 | + 'invalidConfirmationCode' => 'لينك التاكيد غير صالح اة مستخدم من قبل', |
|
| 19 | + 'emailNotConfirmed' => 'بريدك الاكتروني غير مفعل', |
|
| 20 | + 'emailAlreadyConfirmed' => 'البريد الاكتروني مفع بالقعل' |
|
| 21 | 21 | |
| 22 | 22 | ]; |
@@ -4,68 +4,68 @@ |
||
| 4 | 4 | |
| 5 | 5 | class UsersErrors |
| 6 | 6 | { |
| 7 | - public function unAuthorized() |
|
| 8 | - { |
|
| 9 | - abort(401, trans('users::errors.unAuthorized')); |
|
| 10 | - } |
|
| 7 | + public function unAuthorized() |
|
| 8 | + { |
|
| 9 | + abort(401, trans('users::errors.unAuthorized')); |
|
| 10 | + } |
|
| 11 | 11 | |
| 12 | - public function noPermissions() |
|
| 13 | - { |
|
| 14 | - abort(403, trans('users::errors.noPermissions')); |
|
| 15 | - } |
|
| 12 | + public function noPermissions() |
|
| 13 | + { |
|
| 14 | + abort(403, trans('users::errors.noPermissions')); |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - public function userIsBlocked() |
|
| 18 | - { |
|
| 19 | - abort(403, trans('users::errors.userIsBlocked')); |
|
| 20 | - } |
|
| 17 | + public function userIsBlocked() |
|
| 18 | + { |
|
| 19 | + abort(403, trans('users::errors.userIsBlocked')); |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - public function emailNotConfirmed() |
|
| 23 | - { |
|
| 24 | - abort(403, trans('users::errors.emailNotConfirmed')); |
|
| 25 | - } |
|
| 22 | + public function emailNotConfirmed() |
|
| 23 | + { |
|
| 24 | + abort(403, trans('users::errors.emailNotConfirmed')); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - public function loginFailed() |
|
| 28 | - { |
|
| 29 | - abort(400, trans('users::errors.loginFailed')); |
|
| 30 | - } |
|
| 27 | + public function loginFailed() |
|
| 28 | + { |
|
| 29 | + abort(400, trans('users::errors.loginFailed')); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - public function emailAlreadyConfirmed() |
|
| 33 | - { |
|
| 34 | - abort(400, trans('users::errors.emailAlreadyConfirmed')); |
|
| 35 | - } |
|
| 32 | + public function emailAlreadyConfirmed() |
|
| 33 | + { |
|
| 34 | + abort(400, trans('users::errors.emailAlreadyConfirmed')); |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - public function noSocialEmail() |
|
| 38 | - { |
|
| 39 | - abort(400, trans('users::errors.noSocialEmail')); |
|
| 40 | - } |
|
| 37 | + public function noSocialEmail() |
|
| 38 | + { |
|
| 39 | + abort(400, trans('users::errors.noSocialEmail')); |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - public function userAlreadyRegistered() |
|
| 43 | - { |
|
| 44 | - abort(400, trans('users::errors.userAlreadyRegistered')); |
|
| 45 | - } |
|
| 42 | + public function userAlreadyRegistered() |
|
| 43 | + { |
|
| 44 | + abort(400, trans('users::errors.userAlreadyRegistered')); |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - public function invalidRefreshToken() |
|
| 48 | - { |
|
| 49 | - abort(422, trans('users::errors.invalidRefreshToken')); |
|
| 50 | - } |
|
| 47 | + public function invalidRefreshToken() |
|
| 48 | + { |
|
| 49 | + abort(422, trans('users::errors.invalidRefreshToken')); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - public function invalidResetToken() |
|
| 53 | - { |
|
| 54 | - abort(422, trans('users::errors.invalidResetToken')); |
|
| 55 | - } |
|
| 52 | + public function invalidResetToken() |
|
| 53 | + { |
|
| 54 | + abort(422, trans('users::errors.invalidResetToken')); |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - public function invalidResetPassword() |
|
| 58 | - { |
|
| 59 | - abort(422, trans('users::errors.invalidResetPassword')); |
|
| 60 | - } |
|
| 57 | + public function invalidResetPassword() |
|
| 58 | + { |
|
| 59 | + abort(422, trans('users::errors.invalidResetPassword')); |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | - public function invalidOldPassword() |
|
| 63 | - { |
|
| 64 | - abort(422, trans('users::errors.invalidOldPassword')); |
|
| 65 | - } |
|
| 62 | + public function invalidOldPassword() |
|
| 63 | + { |
|
| 64 | + abort(422, trans('users::errors.invalidOldPassword')); |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - public function invalidConfirmationCode() |
|
| 68 | - { |
|
| 69 | - abort(422, trans('users::errors.invalidConfirmationCode')); |
|
| 70 | - } |
|
| 67 | + public function invalidConfirmationCode() |
|
| 68 | + { |
|
| 69 | + abort(422, trans('users::errors.invalidConfirmationCode')); |
|
| 70 | + } |
|
| 71 | 71 | } |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - /** |
|
| 6 | - * Here goes your error messages. |
|
| 7 | - */ |
|
| 5 | + /** |
|
| 6 | + * Here goes your error messages. |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | ]; |