From f4f01dad5b8759800c8a9394da958a4899c745e1 Mon Sep 17 00:00:00 2001 From: Mekaeil Date: Sun, 24 Nov 2024 20:35:05 +0100 Subject: [PATCH] ci: test workflow --- .../User/Provider/UserServiceProvider.php | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/Infrastructure/User/Provider/UserServiceProvider.php b/src/Infrastructure/User/Provider/UserServiceProvider.php index e612dcc..47c8c63 100644 --- a/src/Infrastructure/User/Provider/UserServiceProvider.php +++ b/src/Infrastructure/User/Provider/UserServiceProvider.php @@ -43,18 +43,18 @@ public function boot() // USER MODULE VIEW FILES $this->publishes([ - UserRouteServiceProvider::LP_USER_ROUTE => app_path('/../routes/' . UserRouteServiceProvider::LP_USER_ROUTE_FILE_NAME), - UserRouteServiceProvider::LP_AUTH_ROUTE => app_path('/../routes/' . UserRouteServiceProvider::LP_AUTH_ROUTE_FILE_NAME), + UserRouteServiceProvider::LP_USER_ROUTE => app_path('/../routes/'.UserRouteServiceProvider::LP_USER_ROUTE_FILE_NAME), + UserRouteServiceProvider::LP_AUTH_ROUTE => app_path('/../routes/'.UserRouteServiceProvider::LP_AUTH_ROUTE_FILE_NAME), ], [$this->publishGenericName, 'larapanel-route-user']); // USER MODULE VIEW FILES $this->publishes([ - __DIR__ . sprintf('/../../../Presentation/%s/Stub/View', $this->moduleName) => resource_path(sprintf('views/%s/%s', $this->mainDir, $this->moduleName)), + __DIR__.sprintf('/../../../Presentation/%s/Stub/View', $this->moduleName) => resource_path(sprintf('views/%s/%s', $this->mainDir, $this->moduleName)), ], [$this->publishGenericName, 'larapanel-view-user']); // LANG $this->publishes([ - __DIR__ . '/../../../Presentation/User/Lang/' => resource_path('lang/'), + __DIR__.'/../../../Presentation/User/Lang/' => resource_path('lang/'), ], ['larapanel-lang']); // SEEDERS @@ -69,11 +69,11 @@ public function boot() $this->publishAuthControllers(); // CHECK IF ROUTE EXISTS IN BASE PROJECT, LOAD FROM THERE - if (file_exists(base_path('routes/' . UserRouteServiceProvider::LP_USER_ROUTE_FILE_NAME))) { - $this->loadRoutesFrom(base_path('routes/' . UserRouteServiceProvider::LP_USER_ROUTE_FILE_NAME)); + if (file_exists(base_path('routes/'.UserRouteServiceProvider::LP_USER_ROUTE_FILE_NAME))) { + $this->loadRoutesFrom(base_path('routes/'.UserRouteServiceProvider::LP_USER_ROUTE_FILE_NAME)); } - if (file_exists(base_path('routes/' . UserRouteServiceProvider::LP_AUTH_ROUTE_FILE_NAME))) { - $this->loadRoutesFrom(base_path('routes/' . UserRouteServiceProvider::LP_AUTH_ROUTE_FILE_NAME)); + if (file_exists(base_path('routes/'.UserRouteServiceProvider::LP_AUTH_ROUTE_FILE_NAME))) { + $this->loadRoutesFrom(base_path('routes/'.UserRouteServiceProvider::LP_AUTH_ROUTE_FILE_NAME)); } } @@ -114,14 +114,14 @@ public function register() public function registerViews() { - $viewPath = resource_path('views/modules/' . $this->moduleNameLower); + $viewPath = resource_path('views/modules/'.$this->moduleNameLower); $sourcePath = resource_path(sprintf('/views/%s/%s', $this->mainDir, $this->moduleName)); $this->publishes( [ $sourcePath => $viewPath, ], - ['views', $this->moduleNameLower . '-module-views'] + ['views', $this->moduleNameLower.'-module-views'] ); $this->loadViewsFrom( @@ -132,7 +132,7 @@ public function registerViews() public function registerTranslations() { - $langPath = resource_path('lang/modules/' . $this->moduleNameLower); + $langPath = resource_path('lang/modules/'.$this->moduleNameLower); if (is_dir($langPath)) { $this->loadJsonTranslationsFrom($langPath); @@ -152,8 +152,8 @@ private function getPublishableViewPaths(): array { $paths = []; foreach (config('view.paths') as $path) { - if (is_dir($path . '/modules/' . $this->moduleNameLower)) { - $paths[] = $path . '/modules/' . $this->moduleNameLower; + if (is_dir($path.'/modules/'.$this->moduleNameLower)) { + $paths[] = $path.'/modules/'.$this->moduleNameLower; } } @@ -168,9 +168,9 @@ private function getPublishableViewPaths(): array private function publishMigrationFiles(): void { $this->publishes([ - __DIR__ . '/../Stub/Migrations/2024_01_01_111111_create_users_table.php.stub' => database_path('migrations/2024_01_01_111111_create_users_table.php'), - __DIR__ . '/../Stub/Migrations/2024_01_01_222222_create_groups_table.php.stub' => database_path('migrations/2024_01_01_222222_create_groups_table.php'), - __DIR__ . '/../Stub/Migrations/2024_01_01_333333_edit_permission_tables.php.stub' => database_path('migrations/2024_01_01_333333_edit_permission_tables.php'), + __DIR__.'/../Stub/Migrations/2024_01_01_111111_create_users_table.php.stub' => database_path('migrations/2024_01_01_111111_create_users_table.php'), + __DIR__.'/../Stub/Migrations/2024_01_01_222222_create_groups_table.php.stub' => database_path('migrations/2024_01_01_222222_create_groups_table.php'), + __DIR__.'/../Stub/Migrations/2024_01_01_333333_edit_permission_tables.php.stub' => database_path('migrations/2024_01_01_333333_edit_permission_tables.php'), ], ['larapanel-migrations']); } @@ -182,22 +182,22 @@ private function publishMigrationFiles(): void private function publishAdminControllers(): void { $this->publishes([ - __DIR__ . sprintf('/../../../Presentation/User/Stub/Controller/Admin/PermissionsController.php.stub') => app_path(sprintf('Http/Controllers/%s/%s/Admin/PermissionsController.php', $this->mainDir, $this->moduleName)), - __DIR__ . sprintf('/../../../Presentation/User/Stub/Controller/Admin/RolesController.php.stub') => app_path(sprintf('Http/Controllers/%s/%s/Admin/RolesController.php', $this->mainDir, $this->moduleName)), - __DIR__ . sprintf('/../../../Presentation/User/Stub/Controller/Admin/GroupsController.php.stub') => app_path(sprintf('Http/Controllers/%s/%s/Admin/GroupsController.php', $this->mainDir, $this->moduleName)), - __DIR__ . sprintf('/../../../Presentation/User/Stub/Controller/Admin/UsersController.php.stub') => app_path(sprintf('Http/Controllers/%s/%s/Admin/UsersController.php', $this->mainDir, $this->moduleName)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Controller/Admin/PermissionsController.php.stub') => app_path(sprintf('Http/Controllers/%s/%s/Admin/PermissionsController.php', $this->mainDir, $this->moduleName)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Controller/Admin/RolesController.php.stub') => app_path(sprintf('Http/Controllers/%s/%s/Admin/RolesController.php', $this->mainDir, $this->moduleName)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Controller/Admin/GroupsController.php.stub') => app_path(sprintf('Http/Controllers/%s/%s/Admin/GroupsController.php', $this->mainDir, $this->moduleName)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Controller/Admin/UsersController.php.stub') => app_path(sprintf('Http/Controllers/%s/%s/Admin/UsersController.php', $this->mainDir, $this->moduleName)), ], [$this->publishGenericName, 'larapanel-admin-controller']); $this->publishes([ // Form Request - __DIR__ . sprintf('/../../../Presentation/User/Stub/Requests/Admin/StoreGroupRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/StoreGroupRequest.php', $this->mainDir)), - __DIR__ . sprintf('/../../../Presentation/User/Stub/Requests/Admin/StorePermissionRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/StorePermissionRequest.php', $this->mainDir)), - __DIR__ . sprintf('/../../../Presentation/User/Stub/Requests/Admin/StoreRoleRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/StoreRoleRequest.php', $this->mainDir)), - __DIR__ . sprintf('/../../../Presentation/User/Stub/Requests/Admin/StoreUserRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/StoreUserRequest.php', $this->mainDir)), - __DIR__ . sprintf('/../../../Presentation/User/Stub/Requests/Admin/UpdateGroupRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/UpdateGroupRequest.php', $this->mainDir)), - __DIR__ . sprintf('/../../../Presentation/User/Stub/Requests/Admin/UpdatePermissionRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/UpdatePermissionRequest.php', $this->mainDir)), - __DIR__ . sprintf('/../../../Presentation/User/Stub/Requests/Admin/UpdateRoleRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/UpdateRoleRequest.php', $this->mainDir)), - __DIR__ . sprintf('/../../../Presentation/User/Stub/Requests/Admin/UpdateUserRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/UpdateUserRequest.php', $this->mainDir)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Requests/Admin/StoreGroupRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/StoreGroupRequest.php', $this->mainDir)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Requests/Admin/StorePermissionRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/StorePermissionRequest.php', $this->mainDir)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Requests/Admin/StoreRoleRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/StoreRoleRequest.php', $this->mainDir)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Requests/Admin/StoreUserRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/StoreUserRequest.php', $this->mainDir)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Requests/Admin/UpdateGroupRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/UpdateGroupRequest.php', $this->mainDir)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Requests/Admin/UpdatePermissionRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/UpdatePermissionRequest.php', $this->mainDir)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Requests/Admin/UpdateRoleRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/UpdateRoleRequest.php', $this->mainDir)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Requests/Admin/UpdateUserRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Admin/UpdateUserRequest.php', $this->mainDir)), ], ['larapanel-admin-request']); } @@ -209,31 +209,31 @@ private function publishAdminControllers(): void private function publishAuthControllers(): void { $this->publishes([ - __DIR__ . sprintf('/../../../Presentation/User/Stub/Controller/Auth/SignInController.php.stub') => app_path(sprintf('Http/Controllers/%s/%s/Auth/SignInController.php', $this->mainDir, $this->moduleName)), - __DIR__ . sprintf('/../../../Presentation/User/Stub/Controller/Auth/SignUpController.php.stub') => app_path(sprintf('Http/Controllers/%s/%s/Auth/SignUpController.php', $this->mainDir, $this->moduleName)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Controller/Auth/SignInController.php.stub') => app_path(sprintf('Http/Controllers/%s/%s/Auth/SignInController.php', $this->mainDir, $this->moduleName)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Controller/Auth/SignUpController.php.stub') => app_path(sprintf('Http/Controllers/%s/%s/Auth/SignUpController.php', $this->mainDir, $this->moduleName)), // FormRequest Validation - __DIR__ . sprintf('/../../../Presentation/User/Stub/Requests/Auth/SignInFormRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Auth/SignInFormRequest.php', $this->mainDir)), - __DIR__ . sprintf('/../../../Presentation/User/Stub/Requests/Auth/SignUpFormRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Auth/SignUpFormRequest.php', $this->mainDir)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Requests/Auth/SignInFormRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Auth/SignInFormRequest.php', $this->mainDir)), + __DIR__.sprintf('/../../../Presentation/User/Stub/Requests/Auth/SignUpFormRequest.php.stub') => app_path(sprintf('Http/Requests/%s/Auth/SignUpFormRequest.php', $this->mainDir)), ], [$this->publishGenericName, 'larapanel-auth-controller']); } private function publishModels(): void { $this->publishes([ - __DIR__ . '/../Stub/Models/Permission.php.stub' => app_path(sprintf('Models/%s/Permission.php', $this->mainDir)), - __DIR__ . '/../Stub/Models/Role.php.stub' => app_path(sprintf('Models/%s/Role.php', $this->mainDir)), - __DIR__ . '/../Stub/Models/Group.php.stub' => app_path(sprintf('Models/%s/Group.php', $this->mainDir)), - __DIR__ . '/../Stub/Models/User.php.stub' => app_path(sprintf('Models/%s/User.php', $this->mainDir)), + __DIR__.'/../Stub/Models/Permission.php.stub' => app_path(sprintf('Models/%s/Permission.php', $this->mainDir)), + __DIR__.'/../Stub/Models/Role.php.stub' => app_path(sprintf('Models/%s/Role.php', $this->mainDir)), + __DIR__.'/../Stub/Models/Group.php.stub' => app_path(sprintf('Models/%s/Group.php', $this->mainDir)), + __DIR__.'/../Stub/Models/User.php.stub' => app_path(sprintf('Models/%s/User.php', $this->mainDir)), ], [$this->publishGenericName, 'larapanel-models']); } private function publishSeeders(): void { $this->publishes([ - __DIR__ . '/../Stub/Seeder/PermissionSeeder.php.stub' => database_path('seeders/PermissionSeeder.php'), - __DIR__ . '/../Stub/Seeder/RoleSeeder.php.stub' => database_path('seeders/RoleSeeder.php'), - __DIR__ . '/../Stub/Seeder/GroupSeeder.php.stub' => database_path('seeders/GroupSeeder.php'), + __DIR__.'/../Stub/Seeder/PermissionSeeder.php.stub' => database_path('seeders/PermissionSeeder.php'), + __DIR__.'/../Stub/Seeder/RoleSeeder.php.stub' => database_path('seeders/RoleSeeder.php'), + __DIR__.'/../Stub/Seeder/GroupSeeder.php.stub' => database_path('seeders/GroupSeeder.php'), ], [$this->publishGenericName, 'larapanel-seeders']); } }