Skip to content

Commit

Permalink
Merge pull request #127 from weprodev/feat-83-cicd-workflow-configura…
Browse files Browse the repository at this point in the history
…tion

ci: test workflow
  • Loading branch information
MichaelAndish authored Nov 24, 2024
2 parents 68ab180 + 24e9ea5 commit 8d943ef
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 46 deletions.
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ help:
$(MAKEFILE_LIST)


## INSTALLING AND PREPARING LOCAL ENVIRONEMTN
.PHONY: install
install:
composer install
php ./../../artisan init:git
exit 0

## Clear Cache
.PHONY: clear
clear:
Expand Down
78 changes: 39 additions & 39 deletions src/Infrastructure/User/Provider/UserServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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));
}
}

Expand Down Expand Up @@ -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(
Expand All @@ -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);
Expand All @@ -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;
}
}

Expand All @@ -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']);
}

Expand All @@ -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']);
}

Expand All @@ -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']);
}
}

0 comments on commit 8d943ef

Please sign in to comment.