@@ -6,24 +6,24 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ModuleServiceProvider extends ServiceProvider |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Bootstrap the module services. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function boot() |
|
| 15 | - { |
|
| 16 | - $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'catalog'); |
|
| 17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'catalog'); |
|
| 18 | - } |
|
| 9 | + /** |
|
| 10 | + * Bootstrap the module services. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function boot() |
|
| 15 | + { |
|
| 16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'catalog'); |
|
| 17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'catalog'); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * Register the module services. |
|
| 22 | - * |
|
| 23 | - * @return void |
|
| 24 | - */ |
|
| 25 | - public function register() |
|
| 26 | - { |
|
| 27 | - $this->app->register(RouteServiceProvider::class); |
|
| 28 | - } |
|
| 20 | + /** |
|
| 21 | + * Register the module services. |
|
| 22 | + * |
|
| 23 | + * @return void |
|
| 24 | + */ |
|
| 25 | + public function register() |
|
| 26 | + { |
|
| 27 | + $this->app->register(RouteServiceProvider::class); |
|
| 28 | + } |
|
| 29 | 29 | } |
@@ -8,72 +8,72 @@ |
||
| 8 | 8 | class RouteServiceProvider extends ServiceProvider |
| 9 | 9 | { |
| 10 | 10 | /** |
| 11 | - * This namespace is applied to your controller routes. |
|
| 12 | - * |
|
| 13 | - * In addition, it is set as the URL generator's root namespace. |
|
| 14 | - * |
|
| 15 | - * @var string |
|
| 16 | - */ |
|
| 17 | - protected $namespace = 'App\Modules\V1\Acl\Http\Controllers'; |
|
| 11 | + * This namespace is applied to your controller routes. |
|
| 12 | + * |
|
| 13 | + * In addition, it is set as the URL generator's root namespace. |
|
| 14 | + * |
|
| 15 | + * @var string |
|
| 16 | + */ |
|
| 17 | + protected $namespace = 'App\Modules\V1\Acl\Http\Controllers'; |
|
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * Define your route model bindings, pattern filters, etc. |
|
| 21 | - * |
|
| 22 | - * @return void |
|
| 23 | - */ |
|
| 24 | - public function boot() |
|
| 25 | - { |
|
| 26 | - // |
|
| 19 | + /** |
|
| 20 | + * Define your route model bindings, pattern filters, etc. |
|
| 21 | + * |
|
| 22 | + * @return void |
|
| 23 | + */ |
|
| 24 | + public function boot() |
|
| 25 | + { |
|
| 26 | + // |
|
| 27 | 27 | |
| 28 | - parent::boot(); |
|
| 29 | - } |
|
| 28 | + parent::boot(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Define the routes for the module. |
|
| 33 | - * |
|
| 34 | - * @return void |
|
| 35 | - */ |
|
| 36 | - public function map() |
|
| 37 | - { |
|
| 38 | - $this->mapWebRoutes(); |
|
| 31 | + /** |
|
| 32 | + * Define the routes for the module. |
|
| 33 | + * |
|
| 34 | + * @return void |
|
| 35 | + */ |
|
| 36 | + public function map() |
|
| 37 | + { |
|
| 38 | + $this->mapWebRoutes(); |
|
| 39 | 39 | |
| 40 | - $this->mapApiRoutes(); |
|
| 40 | + $this->mapApiRoutes(); |
|
| 41 | 41 | |
| 42 | - // |
|
| 43 | - } |
|
| 42 | + // |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * Define the "web" routes for the module. |
|
| 47 | - * |
|
| 48 | - * These routes all receive session state, CSRF protection, etc. |
|
| 49 | - * |
|
| 50 | - * @return void |
|
| 51 | - */ |
|
| 52 | - protected function mapWebRoutes() |
|
| 53 | - { |
|
| 54 | - Route::group([ |
|
| 55 | - 'middleware' => 'web', |
|
| 56 | - 'namespace' => $this->namespace, |
|
| 57 | - ], function ($router) { |
|
| 58 | - require module_path('acl', 'Routes/web.php'); |
|
| 59 | - }); |
|
| 60 | - } |
|
| 45 | + /** |
|
| 46 | + * Define the "web" routes for the module. |
|
| 47 | + * |
|
| 48 | + * These routes all receive session state, CSRF protection, etc. |
|
| 49 | + * |
|
| 50 | + * @return void |
|
| 51 | + */ |
|
| 52 | + protected function mapWebRoutes() |
|
| 53 | + { |
|
| 54 | + Route::group([ |
|
| 55 | + 'middleware' => 'web', |
|
| 56 | + 'namespace' => $this->namespace, |
|
| 57 | + ], function ($router) { |
|
| 58 | + require module_path('acl', 'Routes/web.php'); |
|
| 59 | + }); |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | - /** |
|
| 63 | - * Define the "api" routes for the module. |
|
| 64 | - * |
|
| 65 | - * These routes are typically stateless. |
|
| 66 | - * |
|
| 67 | - * @return void |
|
| 68 | - */ |
|
| 69 | - protected function mapApiRoutes() |
|
| 70 | - { |
|
| 71 | - Route::group([ |
|
| 72 | - 'middleware' => 'api', |
|
| 73 | - 'namespace' => $this->namespace, |
|
| 74 | - 'prefix' => 'api', |
|
| 75 | - ], function ($router) { |
|
| 76 | - require module_path('acl', 'Routes/api.php'); |
|
| 77 | - }); |
|
| 78 | - } |
|
| 62 | + /** |
|
| 63 | + * Define the "api" routes for the module. |
|
| 64 | + * |
|
| 65 | + * These routes are typically stateless. |
|
| 66 | + * |
|
| 67 | + * @return void |
|
| 68 | + */ |
|
| 69 | + protected function mapApiRoutes() |
|
| 70 | + { |
|
| 71 | + Route::group([ |
|
| 72 | + 'middleware' => 'api', |
|
| 73 | + 'namespace' => $this->namespace, |
|
| 74 | + 'prefix' => 'api', |
|
| 75 | + ], function ($router) { |
|
| 76 | + require module_path('acl', 'Routes/api.php'); |
|
| 77 | + }); |
|
| 78 | + } |
|
| 79 | 79 | } |
@@ -2,25 +2,25 @@ |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - /** |
|
| 6 | - * List of error messages used in core module. |
|
| 7 | - */ |
|
| 8 | - 'unAuthorized' => 'من فضلك قم بتسجيل الدخول', |
|
| 9 | - 'tokenExpired' => 'انتهت صلاحية الدخول', |
|
| 10 | - 'noPermissions' => 'لا توجد صلاحية', |
|
| 11 | - 'loginFailed' => 'خطأ في البريد لاكتروني او كلمة المرور', |
|
| 12 | - 'noSocialEmail' => 'لا يمكن الحصول علي تابريد الاكتروني', |
|
| 13 | - 'userAlreadyRegistered' => 'المستخد مسجل بالفعل.سجل الدخول بالبريد الاكتروني و كلمة السر', |
|
| 14 | - 'connectionError' => 'خطأ في الاتصال', |
|
| 15 | - 'redisNotRunning' => 'سيرفير الاشعارات لايعمل', |
|
| 16 | - 'dbQueryError' => 'خطا في البيانات', |
|
| 17 | - 'cannotCreateSetting' => 'لا يمكن اضافة اعدادات', |
|
| 18 | - 'cannotUpdateSettingKey' => 'لا يمكن تعديل اعدادات', |
|
| 19 | - 'userIsBlocked' => 'لقد تم حظرك', |
|
| 20 | - 'invalidResetToken' => 'رمز تعديل كلمة المرور خطا', |
|
| 21 | - 'invalidResetPassword' => 'خطا في نعديل كلمة المرور', |
|
| 22 | - 'invalidOldPassword' => 'كلمة السر القديمه خطا', |
|
| 23 | - 'notFound' => 'ال :replace المطلوب غير موجود', |
|
| 24 | - 'generalError' => 'حدث خطا ما', |
|
| 5 | + /** |
|
| 6 | + * List of error messages used in core module. |
|
| 7 | + */ |
|
| 8 | + 'unAuthorized' => 'من فضلك قم بتسجيل الدخول', |
|
| 9 | + 'tokenExpired' => 'انتهت صلاحية الدخول', |
|
| 10 | + 'noPermissions' => 'لا توجد صلاحية', |
|
| 11 | + 'loginFailed' => 'خطأ في البريد لاكتروني او كلمة المرور', |
|
| 12 | + 'noSocialEmail' => 'لا يمكن الحصول علي تابريد الاكتروني', |
|
| 13 | + 'userAlreadyRegistered' => 'المستخد مسجل بالفعل.سجل الدخول بالبريد الاكتروني و كلمة السر', |
|
| 14 | + 'connectionError' => 'خطأ في الاتصال', |
|
| 15 | + 'redisNotRunning' => 'سيرفير الاشعارات لايعمل', |
|
| 16 | + 'dbQueryError' => 'خطا في البيانات', |
|
| 17 | + 'cannotCreateSetting' => 'لا يمكن اضافة اعدادات', |
|
| 18 | + 'cannotUpdateSettingKey' => 'لا يمكن تعديل اعدادات', |
|
| 19 | + 'userIsBlocked' => 'لقد تم حظرك', |
|
| 20 | + 'invalidResetToken' => 'رمز تعديل كلمة المرور خطا', |
|
| 21 | + 'invalidResetPassword' => 'خطا في نعديل كلمة المرور', |
|
| 22 | + 'invalidOldPassword' => 'كلمة السر القديمه خطا', |
|
| 23 | + 'notFound' => 'ال :replace المطلوب غير موجود', |
|
| 24 | + 'generalError' => 'حدث خطا ما', |
|
| 25 | 25 | |
| 26 | 26 | ]; |
| 27 | 27 | \ No newline at end of file |
@@ -2,25 +2,25 @@ |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - /** |
|
| 6 | - * List of error messages used in core module. |
|
| 7 | - */ |
|
| 8 | - 'unAuthorized' => 'Please login before any action', |
|
| 9 | - 'tokenExpired' => 'Login token expired', |
|
| 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 | - 'connectionError' => 'Connection error', |
|
| 15 | - 'redisNotRunning' => 'Your redis notification server is\'t running', |
|
| 16 | - 'dbQueryError' => 'Please check the given inputes', |
|
| 17 | - 'cannotCreateSetting' => 'Can\'t create setting', |
|
| 18 | - 'cannotUpdateSettingKey' => 'Can\'t update setting key', |
|
| 19 | - 'userIsBlocked' => 'You have been blocked', |
|
| 20 | - 'invalidResetToken' => 'Reset password token is invalid', |
|
| 21 | - 'invalidResetPassword' => 'Reset password is invalid', |
|
| 22 | - 'invalidOldPassword' => 'Old password is invalid', |
|
| 23 | - 'notFound' => 'The requested :replace not found', |
|
| 24 | - 'generalError' => 'Something went wrong', |
|
| 5 | + /** |
|
| 6 | + * List of error messages used in core module. |
|
| 7 | + */ |
|
| 8 | + 'unAuthorized' => 'Please login before any action', |
|
| 9 | + 'tokenExpired' => 'Login token expired', |
|
| 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 | + 'connectionError' => 'Connection error', |
|
| 15 | + 'redisNotRunning' => 'Your redis notification server is\'t running', |
|
| 16 | + 'dbQueryError' => 'Please check the given inputes', |
|
| 17 | + 'cannotCreateSetting' => 'Can\'t create setting', |
|
| 18 | + 'cannotUpdateSettingKey' => 'Can\'t update setting key', |
|
| 19 | + 'userIsBlocked' => 'You have been blocked', |
|
| 20 | + 'invalidResetToken' => 'Reset password token is invalid', |
|
| 21 | + 'invalidResetPassword' => 'Reset password is invalid', |
|
| 22 | + 'invalidOldPassword' => 'Old password is invalid', |
|
| 23 | + 'notFound' => 'The requested :replace not found', |
|
| 24 | + 'generalError' => 'Something went wrong', |
|
| 25 | 25 | |
| 26 | 26 | ]; |
| 27 | 27 | \ No newline at end of file |
@@ -5,27 +5,27 @@ |
||
| 5 | 5 | |
| 6 | 6 | class PasswordResets extends Migration |
| 7 | 7 | { |
| 8 | - /** |
|
| 9 | - * Run the migrations. |
|
| 10 | - * |
|
| 11 | - * @return void |
|
| 12 | - */ |
|
| 13 | - public function up() |
|
| 14 | - { |
|
| 15 | - Schema::create('password_resets', function (Blueprint $table) { |
|
| 16 | - $table->string('email')->index(); |
|
| 17 | - $table->string('token')->index(); |
|
| 18 | - $table->timestamp('created_at'); |
|
| 19 | - }); |
|
| 20 | - } |
|
| 8 | + /** |
|
| 9 | + * Run the migrations. |
|
| 10 | + * |
|
| 11 | + * @return void |
|
| 12 | + */ |
|
| 13 | + public function up() |
|
| 14 | + { |
|
| 15 | + Schema::create('password_resets', function (Blueprint $table) { |
|
| 16 | + $table->string('email')->index(); |
|
| 17 | + $table->string('token')->index(); |
|
| 18 | + $table->timestamp('created_at'); |
|
| 19 | + }); |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * Reverse the migrations. |
|
| 24 | - * |
|
| 25 | - * @return void |
|
| 26 | - */ |
|
| 27 | - public function down() |
|
| 28 | - { |
|
| 29 | - Schema::dropIfExists('password_resets'); |
|
| 30 | - } |
|
| 22 | + /** |
|
| 23 | + * Reverse the migrations. |
|
| 24 | + * |
|
| 25 | + * @return void |
|
| 26 | + */ |
|
| 27 | + public function down() |
|
| 28 | + { |
|
| 29 | + Schema::dropIfExists('password_resets'); |
|
| 30 | + } |
|
| 31 | 31 | } |
@@ -13,16 +13,16 @@ |
||
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | 15 | Schema::create('users', function (Blueprint $table) { |
| 16 | - $table->increments('id'); |
|
| 17 | - $table->string('name', 100)->nullable(); |
|
| 18 | - $table->string('email')->unique(); |
|
| 19 | - $table->string('password', 60)->nullable(); |
|
| 20 | - $table->boolean('blocked')->default(0); |
|
| 16 | + $table->increments('id'); |
|
| 17 | + $table->string('name', 100)->nullable(); |
|
| 18 | + $table->string('email')->unique(); |
|
| 19 | + $table->string('password', 60)->nullable(); |
|
| 20 | + $table->boolean('blocked')->default(0); |
|
| 21 | 21 | $table->date('last_change_password')->nullable(); |
| 22 | - $table->softDeletes(); |
|
| 23 | - $table->rememberToken(); |
|
| 24 | - $table->timestamps(); |
|
| 25 | - }); |
|
| 22 | + $table->softDeletes(); |
|
| 23 | + $table->rememberToken(); |
|
| 24 | + $table->timestamps(); |
|
| 25 | + }); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -2,105 +2,105 @@ |
||
| 2 | 2 | |
| 3 | 3 | class ErrorHandler |
| 4 | 4 | { |
| 5 | - public function unAuthorized() |
|
| 6 | - { |
|
| 7 | - $error = ['status' => 401, 'message' => trans('errors.unAuthorized')]; |
|
| 8 | - abort($error['status'], $error['message']); |
|
| 9 | - } |
|
| 10 | - |
|
| 11 | - public function tokenExpired() |
|
| 12 | - { |
|
| 13 | - $error = ['status' => 403, 'message' => trans('errors.tokenExpired')]; |
|
| 14 | - abort($error['status'], $error['message']); |
|
| 15 | - } |
|
| 16 | - |
|
| 17 | - public function noPermissions() |
|
| 18 | - { |
|
| 19 | - $error = ['status' => 403, 'message' => trans('errors.noPermissions')]; |
|
| 20 | - abort($error['status'], $error['message']); |
|
| 21 | - } |
|
| 22 | - |
|
| 23 | - public function loginFailed() |
|
| 24 | - { |
|
| 25 | - $error = ['status' => 400, 'message' => trans('errors.loginFailed')]; |
|
| 26 | - abort($error['status'], $error['message']); |
|
| 27 | - } |
|
| 28 | - |
|
| 29 | - public function noSocialEmail() |
|
| 30 | - { |
|
| 31 | - $error = ['status' => 400, 'message' => trans('errors.noSocialEmail')]; |
|
| 32 | - abort($error['status'], $error['message']); |
|
| 33 | - } |
|
| 34 | - |
|
| 35 | - public function userAlreadyRegistered() |
|
| 36 | - { |
|
| 37 | - $error = ['status' => 400, 'message' => trans('errors.userAlreadyRegistered')]; |
|
| 38 | - abort($error['status'], $error['message']); |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - public function connectionError() |
|
| 42 | - { |
|
| 43 | - $error = ['status' => 400, 'message' => trans('errors.connectionError')]; |
|
| 44 | - abort($error['status'], $error['message']); |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - public function redisNotRunning() |
|
| 48 | - { |
|
| 49 | - $error = ['status' => 400, 'message' => trans('errors.redisNotRunning')]; |
|
| 50 | - abort($error['status'], $error['message']); |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - public function dbQueryError() |
|
| 54 | - { |
|
| 55 | - $error = ['status' => 400, 'message' => trans('errors.dbQueryError')]; |
|
| 56 | - abort($error['status'], $error['message']); |
|
| 57 | - } |
|
| 58 | - |
|
| 59 | - public function cannotCreateSetting() |
|
| 60 | - { |
|
| 61 | - $error = ['status' => 400, 'message' => trans('errors.cannotCreateSetting')]; |
|
| 62 | - abort($error['status'], $error['message']); |
|
| 63 | - } |
|
| 64 | - |
|
| 65 | - public function cannotUpdateSettingKey() |
|
| 66 | - { |
|
| 67 | - $error = ['status' => 400, 'message' => trans('errors.cannotUpdateSettingKey')]; |
|
| 68 | - abort($error['status'], $error['message']); |
|
| 69 | - } |
|
| 70 | - |
|
| 71 | - public function userIsBlocked() |
|
| 72 | - { |
|
| 73 | - $error = ['status' => 403, 'message' => trans('errors.userIsBlocked')]; |
|
| 74 | - abort($error['status'], $error['message']); |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - public function invalidResetToken() |
|
| 78 | - { |
|
| 79 | - $error = ['status' => 400, 'message' => trans('errors.invalidResetToken')]; |
|
| 80 | - abort($error['status'], $error['message']); |
|
| 81 | - } |
|
| 82 | - |
|
| 83 | - public function invalidResetPassword() |
|
| 84 | - { |
|
| 85 | - $error = ['status' => 400, 'message' => trans('errors.invalidResetPassword')]; |
|
| 86 | - abort($error['status'], $error['message']); |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - public function invalidOldPassword() |
|
| 90 | - { |
|
| 91 | - $error = ['status' => 400, 'message' => trans('errors.invalidOldPassword')]; |
|
| 92 | - abort($error['status'], $error['message']); |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - public function notFound($text) |
|
| 96 | - { |
|
| 97 | - $error = ['status' => 404, 'message' => trans('errors.notFound', ['replace' => $text])]; |
|
| 98 | - abort($error['status'], $error['message']); |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - public function generalError() |
|
| 102 | - { |
|
| 103 | - $error = ['status' => 404, 'message' => trans('errors.generalError')]; |
|
| 104 | - abort($error['status'], $error['message']); |
|
| 105 | - } |
|
| 5 | + public function unAuthorized() |
|
| 6 | + { |
|
| 7 | + $error = ['status' => 401, 'message' => trans('errors.unAuthorized')]; |
|
| 8 | + abort($error['status'], $error['message']); |
|
| 9 | + } |
|
| 10 | + |
|
| 11 | + public function tokenExpired() |
|
| 12 | + { |
|
| 13 | + $error = ['status' => 403, 'message' => trans('errors.tokenExpired')]; |
|
| 14 | + abort($error['status'], $error['message']); |
|
| 15 | + } |
|
| 16 | + |
|
| 17 | + public function noPermissions() |
|
| 18 | + { |
|
| 19 | + $error = ['status' => 403, 'message' => trans('errors.noPermissions')]; |
|
| 20 | + abort($error['status'], $error['message']); |
|
| 21 | + } |
|
| 22 | + |
|
| 23 | + public function loginFailed() |
|
| 24 | + { |
|
| 25 | + $error = ['status' => 400, 'message' => trans('errors.loginFailed')]; |
|
| 26 | + abort($error['status'], $error['message']); |
|
| 27 | + } |
|
| 28 | + |
|
| 29 | + public function noSocialEmail() |
|
| 30 | + { |
|
| 31 | + $error = ['status' => 400, 'message' => trans('errors.noSocialEmail')]; |
|
| 32 | + abort($error['status'], $error['message']); |
|
| 33 | + } |
|
| 34 | + |
|
| 35 | + public function userAlreadyRegistered() |
|
| 36 | + { |
|
| 37 | + $error = ['status' => 400, 'message' => trans('errors.userAlreadyRegistered')]; |
|
| 38 | + abort($error['status'], $error['message']); |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + public function connectionError() |
|
| 42 | + { |
|
| 43 | + $error = ['status' => 400, 'message' => trans('errors.connectionError')]; |
|
| 44 | + abort($error['status'], $error['message']); |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + public function redisNotRunning() |
|
| 48 | + { |
|
| 49 | + $error = ['status' => 400, 'message' => trans('errors.redisNotRunning')]; |
|
| 50 | + abort($error['status'], $error['message']); |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + public function dbQueryError() |
|
| 54 | + { |
|
| 55 | + $error = ['status' => 400, 'message' => trans('errors.dbQueryError')]; |
|
| 56 | + abort($error['status'], $error['message']); |
|
| 57 | + } |
|
| 58 | + |
|
| 59 | + public function cannotCreateSetting() |
|
| 60 | + { |
|
| 61 | + $error = ['status' => 400, 'message' => trans('errors.cannotCreateSetting')]; |
|
| 62 | + abort($error['status'], $error['message']); |
|
| 63 | + } |
|
| 64 | + |
|
| 65 | + public function cannotUpdateSettingKey() |
|
| 66 | + { |
|
| 67 | + $error = ['status' => 400, 'message' => trans('errors.cannotUpdateSettingKey')]; |
|
| 68 | + abort($error['status'], $error['message']); |
|
| 69 | + } |
|
| 70 | + |
|
| 71 | + public function userIsBlocked() |
|
| 72 | + { |
|
| 73 | + $error = ['status' => 403, 'message' => trans('errors.userIsBlocked')]; |
|
| 74 | + abort($error['status'], $error['message']); |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + public function invalidResetToken() |
|
| 78 | + { |
|
| 79 | + $error = ['status' => 400, 'message' => trans('errors.invalidResetToken')]; |
|
| 80 | + abort($error['status'], $error['message']); |
|
| 81 | + } |
|
| 82 | + |
|
| 83 | + public function invalidResetPassword() |
|
| 84 | + { |
|
| 85 | + $error = ['status' => 400, 'message' => trans('errors.invalidResetPassword')]; |
|
| 86 | + abort($error['status'], $error['message']); |
|
| 87 | + } |
|
| 88 | + |
|
| 89 | + public function invalidOldPassword() |
|
| 90 | + { |
|
| 91 | + $error = ['status' => 400, 'message' => trans('errors.invalidOldPassword')]; |
|
| 92 | + abort($error['status'], $error['message']); |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + public function notFound($text) |
|
| 96 | + { |
|
| 97 | + $error = ['status' => 404, 'message' => trans('errors.notFound', ['replace' => $text])]; |
|
| 98 | + abort($error['status'], $error['message']); |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + public function generalError() |
|
| 102 | + { |
|
| 103 | + $error = ['status' => 404, 'message' => trans('errors.generalError')]; |
|
| 104 | + abort($error['status'], $error['message']); |
|
| 105 | + } |
|
| 106 | 106 | } |
| 107 | 107 | \ No newline at end of file |
@@ -13,140 +13,140 @@ |
||
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * Insert the permissions related to this module. |
|
| 17 | - */ |
|
| 18 | - DB::table('permissions')->insert( |
|
| 19 | - [ |
|
| 20 | - /** |
|
| 21 | - * notifications model permissions. |
|
| 22 | - */ |
|
| 23 | - [ |
|
| 24 | - 'name' => 'find', |
|
| 25 | - 'model' => 'notifications', |
|
| 26 | - 'created_at' => \DB::raw('NOW()'), |
|
| 27 | - 'updated_at' => \DB::raw('NOW()') |
|
| 28 | - ], |
|
| 29 | - [ |
|
| 30 | - 'name' => 'search', |
|
| 31 | - 'model' => 'notifications', |
|
| 32 | - 'created_at' => \DB::raw('NOW()'), |
|
| 33 | - 'updated_at' => \DB::raw('NOW()') |
|
| 34 | - ], |
|
| 35 | - [ |
|
| 36 | - 'name' => 'list', |
|
| 37 | - 'model' => 'notifications', |
|
| 38 | - 'created_at' => \DB::raw('NOW()'), |
|
| 39 | - 'updated_at' => \DB::raw('NOW()') |
|
| 40 | - ], |
|
| 41 | - [ |
|
| 42 | - 'name' => 'findby', |
|
| 43 | - 'model' => 'notifications', |
|
| 44 | - 'created_at' => \DB::raw('NOW()'), |
|
| 45 | - 'updated_at' => \DB::raw('NOW()') |
|
| 46 | - ], |
|
| 47 | - [ |
|
| 48 | - 'name' => 'first', |
|
| 49 | - 'model' => 'notifications', |
|
| 50 | - 'created_at' => \DB::raw('NOW()'), |
|
| 51 | - 'updated_at' => \DB::raw('NOW()') |
|
| 52 | - ], |
|
| 53 | - [ |
|
| 54 | - 'name' => 'paginate', |
|
| 55 | - 'model' => 'notifications', |
|
| 56 | - 'created_at' => \DB::raw('NOW()'), |
|
| 57 | - 'updated_at' => \DB::raw('NOW()') |
|
| 58 | - ], |
|
| 59 | - [ |
|
| 60 | - 'name' => 'paginateby', |
|
| 61 | - 'model' => 'notifications', |
|
| 62 | - 'created_at' => \DB::raw('NOW()'), |
|
| 63 | - 'updated_at' => \DB::raw('NOW()') |
|
| 64 | - ], |
|
| 65 | - [ |
|
| 66 | - 'name' => 'notified', |
|
| 67 | - 'model' => 'notifications', |
|
| 68 | - 'created_at' => \DB::raw('NOW()'), |
|
| 69 | - 'updated_at' => \DB::raw('NOW()') |
|
| 70 | - ], |
|
| 71 | - [ |
|
| 72 | - 'name' => 'notifyall', |
|
| 73 | - 'model' => 'notifications', |
|
| 74 | - 'created_at' => \DB::raw('NOW()'), |
|
| 75 | - 'updated_at' => \DB::raw('NOW()') |
|
| 76 | - ], |
|
| 77 | - /** |
|
| 78 | - * pushNotificationDevices model permissions. |
|
| 79 | - */ |
|
| 80 | - [ |
|
| 81 | - 'name' => 'find', |
|
| 82 | - 'model' => 'pushNotificationDevices', |
|
| 83 | - 'created_at' => \DB::raw('NOW()'), |
|
| 84 | - 'updated_at' => \DB::raw('NOW()') |
|
| 85 | - ], |
|
| 86 | - [ |
|
| 87 | - 'name' => 'search', |
|
| 88 | - 'model' => 'pushNotificationDevices', |
|
| 89 | - 'created_at' => \DB::raw('NOW()'), |
|
| 90 | - 'updated_at' => \DB::raw('NOW()') |
|
| 91 | - ], |
|
| 92 | - [ |
|
| 93 | - 'name' => 'list', |
|
| 94 | - 'model' => 'pushNotificationDevices', |
|
| 95 | - 'created_at' => \DB::raw('NOW()'), |
|
| 96 | - 'updated_at' => \DB::raw('NOW()') |
|
| 97 | - ], |
|
| 98 | - [ |
|
| 99 | - 'name' => 'findby', |
|
| 100 | - 'model' => 'pushNotificationDevices', |
|
| 101 | - 'created_at' => \DB::raw('NOW()'), |
|
| 102 | - 'updated_at' => \DB::raw('NOW()') |
|
| 103 | - ], |
|
| 104 | - [ |
|
| 105 | - 'name' => 'first', |
|
| 106 | - 'model' => 'pushNotificationDevices', |
|
| 107 | - 'created_at' => \DB::raw('NOW()'), |
|
| 108 | - 'updated_at' => \DB::raw('NOW()') |
|
| 109 | - ], |
|
| 110 | - [ |
|
| 111 | - 'name' => 'paginate', |
|
| 112 | - 'model' => 'pushNotificationDevices', |
|
| 113 | - 'created_at' => \DB::raw('NOW()'), |
|
| 114 | - 'updated_at' => \DB::raw('NOW()') |
|
| 115 | - ], |
|
| 116 | - [ |
|
| 117 | - 'name' => 'paginateby', |
|
| 118 | - 'model' => 'pushNotificationDevices', |
|
| 119 | - 'created_at' => \DB::raw('NOW()'), |
|
| 120 | - 'updated_at' => \DB::raw('NOW()') |
|
| 121 | - ], |
|
| 122 | - [ |
|
| 123 | - 'name' => 'save', |
|
| 124 | - 'model' => 'pushNotificationDevices', |
|
| 125 | - 'created_at' => \DB::raw('NOW()'), |
|
| 126 | - 'updated_at' => \DB::raw('NOW()') |
|
| 127 | - ], |
|
| 128 | - [ |
|
| 129 | - 'name' => 'delete', |
|
| 130 | - 'model' => 'pushNotificationDevices', |
|
| 131 | - 'created_at' => \DB::raw('NOW()'), |
|
| 132 | - 'updated_at' => \DB::raw('NOW()') |
|
| 133 | - ], |
|
| 134 | - [ |
|
| 135 | - 'name' => 'deleted', |
|
| 136 | - 'model' => 'pushNotificationDevices', |
|
| 137 | - 'created_at' => \DB::raw('NOW()'), |
|
| 138 | - 'updated_at' => \DB::raw('NOW()') |
|
| 139 | - ], |
|
| 140 | - [ |
|
| 141 | - 'name' => 'restore', |
|
| 142 | - 'model' => 'pushNotificationDevices', |
|
| 143 | - 'created_at' => \DB::raw('NOW()'), |
|
| 144 | - 'updated_at' => \DB::raw('NOW()') |
|
| 145 | - ], |
|
| 146 | - ] |
|
| 147 | - ); |
|
| 16 | + * Insert the permissions related to this module. |
|
| 17 | + */ |
|
| 18 | + DB::table('permissions')->insert( |
|
| 19 | + [ |
|
| 20 | + /** |
|
| 21 | + * notifications model permissions. |
|
| 22 | + */ |
|
| 23 | + [ |
|
| 24 | + 'name' => 'find', |
|
| 25 | + 'model' => 'notifications', |
|
| 26 | + 'created_at' => \DB::raw('NOW()'), |
|
| 27 | + 'updated_at' => \DB::raw('NOW()') |
|
| 28 | + ], |
|
| 29 | + [ |
|
| 30 | + 'name' => 'search', |
|
| 31 | + 'model' => 'notifications', |
|
| 32 | + 'created_at' => \DB::raw('NOW()'), |
|
| 33 | + 'updated_at' => \DB::raw('NOW()') |
|
| 34 | + ], |
|
| 35 | + [ |
|
| 36 | + 'name' => 'list', |
|
| 37 | + 'model' => 'notifications', |
|
| 38 | + 'created_at' => \DB::raw('NOW()'), |
|
| 39 | + 'updated_at' => \DB::raw('NOW()') |
|
| 40 | + ], |
|
| 41 | + [ |
|
| 42 | + 'name' => 'findby', |
|
| 43 | + 'model' => 'notifications', |
|
| 44 | + 'created_at' => \DB::raw('NOW()'), |
|
| 45 | + 'updated_at' => \DB::raw('NOW()') |
|
| 46 | + ], |
|
| 47 | + [ |
|
| 48 | + 'name' => 'first', |
|
| 49 | + 'model' => 'notifications', |
|
| 50 | + 'created_at' => \DB::raw('NOW()'), |
|
| 51 | + 'updated_at' => \DB::raw('NOW()') |
|
| 52 | + ], |
|
| 53 | + [ |
|
| 54 | + 'name' => 'paginate', |
|
| 55 | + 'model' => 'notifications', |
|
| 56 | + 'created_at' => \DB::raw('NOW()'), |
|
| 57 | + 'updated_at' => \DB::raw('NOW()') |
|
| 58 | + ], |
|
| 59 | + [ |
|
| 60 | + 'name' => 'paginateby', |
|
| 61 | + 'model' => 'notifications', |
|
| 62 | + 'created_at' => \DB::raw('NOW()'), |
|
| 63 | + 'updated_at' => \DB::raw('NOW()') |
|
| 64 | + ], |
|
| 65 | + [ |
|
| 66 | + 'name' => 'notified', |
|
| 67 | + 'model' => 'notifications', |
|
| 68 | + 'created_at' => \DB::raw('NOW()'), |
|
| 69 | + 'updated_at' => \DB::raw('NOW()') |
|
| 70 | + ], |
|
| 71 | + [ |
|
| 72 | + 'name' => 'notifyall', |
|
| 73 | + 'model' => 'notifications', |
|
| 74 | + 'created_at' => \DB::raw('NOW()'), |
|
| 75 | + 'updated_at' => \DB::raw('NOW()') |
|
| 76 | + ], |
|
| 77 | + /** |
|
| 78 | + * pushNotificationDevices model permissions. |
|
| 79 | + */ |
|
| 80 | + [ |
|
| 81 | + 'name' => 'find', |
|
| 82 | + 'model' => 'pushNotificationDevices', |
|
| 83 | + 'created_at' => \DB::raw('NOW()'), |
|
| 84 | + 'updated_at' => \DB::raw('NOW()') |
|
| 85 | + ], |
|
| 86 | + [ |
|
| 87 | + 'name' => 'search', |
|
| 88 | + 'model' => 'pushNotificationDevices', |
|
| 89 | + 'created_at' => \DB::raw('NOW()'), |
|
| 90 | + 'updated_at' => \DB::raw('NOW()') |
|
| 91 | + ], |
|
| 92 | + [ |
|
| 93 | + 'name' => 'list', |
|
| 94 | + 'model' => 'pushNotificationDevices', |
|
| 95 | + 'created_at' => \DB::raw('NOW()'), |
|
| 96 | + 'updated_at' => \DB::raw('NOW()') |
|
| 97 | + ], |
|
| 98 | + [ |
|
| 99 | + 'name' => 'findby', |
|
| 100 | + 'model' => 'pushNotificationDevices', |
|
| 101 | + 'created_at' => \DB::raw('NOW()'), |
|
| 102 | + 'updated_at' => \DB::raw('NOW()') |
|
| 103 | + ], |
|
| 104 | + [ |
|
| 105 | + 'name' => 'first', |
|
| 106 | + 'model' => 'pushNotificationDevices', |
|
| 107 | + 'created_at' => \DB::raw('NOW()'), |
|
| 108 | + 'updated_at' => \DB::raw('NOW()') |
|
| 109 | + ], |
|
| 110 | + [ |
|
| 111 | + 'name' => 'paginate', |
|
| 112 | + 'model' => 'pushNotificationDevices', |
|
| 113 | + 'created_at' => \DB::raw('NOW()'), |
|
| 114 | + 'updated_at' => \DB::raw('NOW()') |
|
| 115 | + ], |
|
| 116 | + [ |
|
| 117 | + 'name' => 'paginateby', |
|
| 118 | + 'model' => 'pushNotificationDevices', |
|
| 119 | + 'created_at' => \DB::raw('NOW()'), |
|
| 120 | + 'updated_at' => \DB::raw('NOW()') |
|
| 121 | + ], |
|
| 122 | + [ |
|
| 123 | + 'name' => 'save', |
|
| 124 | + 'model' => 'pushNotificationDevices', |
|
| 125 | + 'created_at' => \DB::raw('NOW()'), |
|
| 126 | + 'updated_at' => \DB::raw('NOW()') |
|
| 127 | + ], |
|
| 128 | + [ |
|
| 129 | + 'name' => 'delete', |
|
| 130 | + 'model' => 'pushNotificationDevices', |
|
| 131 | + 'created_at' => \DB::raw('NOW()'), |
|
| 132 | + 'updated_at' => \DB::raw('NOW()') |
|
| 133 | + ], |
|
| 134 | + [ |
|
| 135 | + 'name' => 'deleted', |
|
| 136 | + 'model' => 'pushNotificationDevices', |
|
| 137 | + 'created_at' => \DB::raw('NOW()'), |
|
| 138 | + 'updated_at' => \DB::raw('NOW()') |
|
| 139 | + ], |
|
| 140 | + [ |
|
| 141 | + 'name' => 'restore', |
|
| 142 | + 'model' => 'pushNotificationDevices', |
|
| 143 | + 'created_at' => \DB::raw('NOW()'), |
|
| 144 | + 'updated_at' => \DB::raw('NOW()') |
|
| 145 | + ], |
|
| 146 | + ] |
|
| 147 | + ); |
|
| 148 | 148 | |
| 149 | - /** |
|
| 149 | + /** |
|
| 150 | 150 | * Assign the permissions to the admin group. |
| 151 | 151 | */ |
| 152 | 152 | $permissionIds = DB::table('permissions')->whereIn('model', ['notifications', 'pushNotificationDevices'])->select('id')->pluck('id'); |
@@ -5,44 +5,44 @@ |
||
| 5 | 5 | */ |
| 6 | 6 | class AclPermissionObserver { |
| 7 | 7 | |
| 8 | - public function saving($model) |
|
| 9 | - { |
|
| 10 | - // |
|
| 11 | - } |
|
| 12 | - |
|
| 13 | - public function saved($model) |
|
| 14 | - { |
|
| 15 | - // |
|
| 16 | - } |
|
| 17 | - |
|
| 18 | - public function creating($model) |
|
| 19 | - { |
|
| 20 | - // |
|
| 21 | - } |
|
| 22 | - |
|
| 23 | - public function created($model) |
|
| 24 | - { |
|
| 25 | - // |
|
| 26 | - } |
|
| 27 | - |
|
| 28 | - public function updating($model) |
|
| 29 | - { |
|
| 30 | - // |
|
| 31 | - } |
|
| 32 | - |
|
| 33 | - public function updated($model) |
|
| 34 | - { |
|
| 35 | - // |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - public function deleting($model) |
|
| 39 | - { |
|
| 40 | - // |
|
| 41 | - } |
|
| 42 | - |
|
| 43 | - public function deleted($model) |
|
| 44 | - { |
|
| 45 | - // |
|
| 46 | - } |
|
| 8 | + public function saving($model) |
|
| 9 | + { |
|
| 10 | + // |
|
| 11 | + } |
|
| 12 | + |
|
| 13 | + public function saved($model) |
|
| 14 | + { |
|
| 15 | + // |
|
| 16 | + } |
|
| 17 | + |
|
| 18 | + public function creating($model) |
|
| 19 | + { |
|
| 20 | + // |
|
| 21 | + } |
|
| 22 | + |
|
| 23 | + public function created($model) |
|
| 24 | + { |
|
| 25 | + // |
|
| 26 | + } |
|
| 27 | + |
|
| 28 | + public function updating($model) |
|
| 29 | + { |
|
| 30 | + // |
|
| 31 | + } |
|
| 32 | + |
|
| 33 | + public function updated($model) |
|
| 34 | + { |
|
| 35 | + // |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + public function deleting($model) |
|
| 39 | + { |
|
| 40 | + // |
|
| 41 | + } |
|
| 42 | + |
|
| 43 | + public function deleted($model) |
|
| 44 | + { |
|
| 45 | + // |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | 48 | } |
| 49 | 49 | \ No newline at end of file |