From 36d04c8f68982aa6bc29b46d3aa1cc815e0f9152 Mon Sep 17 00:00:00 2001 From: ro Date: Sun, 12 May 2024 22:14:53 -0600 Subject: [PATCH] reorganized services service classes are beginning to swell as there functionality is being fleshed out, so a new organizational structure was needed to make sure class sizes don't become too large and to increase site managability and legibilty as more features get added and the code base grows. data is for retrieving, managing site information, assets interact with external files and upkeep is for maintenance. some additional tweaks were also made to the options menu template to prep it for it's transition to a toolbar component --- app/Http/Controllers/AuthController.php | 2 +- app/Http/Controllers/DashController.php | 6 ++-- app/Http/Controllers/FrontController.php | 8 +++--- app/Http/Controllers/RouteController.php | 2 +- app/Http/Controllers/ThemeController.php | 8 +++--- app/Providers/FipamoServiceProvider.php | 28 +++++++++++-------- app/Repositories/PageRepository.php | 14 ++++++---- app/Services/{ => Assets}/AssetService.php | 4 ++- app/Services/{ => Assets}/DocService.php | 2 +- .../{ => Assets}/FileUploadService.php | 2 +- app/Services/{ => Assets}/RenderService.php | 5 +++- app/Services/{ => Data}/AuthService.php | 2 +- app/Services/{ => Data}/ContentService.php | 2 +- app/Services/{ => Data}/PaginateService.php | 2 +- app/Services/{ => Data}/SettingsService.php | 3 +- app/Services/{ => Data}/SortingService.php | 2 +- app/Services/{ => Data}/ThemeService.php | 2 +- app/Services/{ => Upkeep}/InitService.php | 2 +- .../{ => Upkeep}/MaintenanceService.php | 0 resources/views/includes/options.blade.php | 3 +- 20 files changed, 56 insertions(+), 43 deletions(-) rename app/Services/{ => Assets}/AssetService.php (98%) rename app/Services/{ => Assets}/DocService.php (99%) rename app/Services/{ => Assets}/FileUploadService.php (98%) rename app/Services/{ => Assets}/RenderService.php (96%) rename app/Services/{ => Data}/AuthService.php (98%) rename app/Services/{ => Data}/ContentService.php (99%) rename app/Services/{ => Data}/PaginateService.php (98%) rename app/Services/{ => Data}/SettingsService.php (99%) rename app/Services/{ => Data}/SortingService.php (99%) rename app/Services/{ => Data}/ThemeService.php (98%) rename app/Services/{ => Upkeep}/InitService.php (99%) rename app/Services/{ => Upkeep}/MaintenanceService.php (100%) diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 74978e4..e6565b8 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -3,7 +3,7 @@ namespace App\Http\Controllers; use Symfony\Component\HttpFoundation\Response; -use App\Services\AuthService; +use App\Services\Data\AuthService; use Illuminate\Http\Request; class AuthController extends Controller diff --git a/app/Http/Controllers/DashController.php b/app/Http/Controllers/DashController.php index 41199c7..94eaf1c 100644 --- a/app/Http/Controllers/DashController.php +++ b/app/Http/Controllers/DashController.php @@ -3,9 +3,9 @@ namespace App\Http\Controllers; use App\Interfaces\PageRepositoryInterface; -use App\Services\AuthService; -use App\Services\ThemeService; -use App\Services\SortingService; +use App\Services\Data\AuthService; +use App\Services\Data\ThemeService; +use App\Services\Data\SortingService; class DashController extends Controller { diff --git a/app/Http/Controllers/FrontController.php b/app/Http/Controllers/FrontController.php index 4233e73..6914cf8 100644 --- a/app/Http/Controllers/FrontController.php +++ b/app/Http/Controllers/FrontController.php @@ -2,11 +2,11 @@ namespace App\Http\Controllers; -use App\Services\SettingsService; -use App\Services\AuthService; use App\Interfaces\PageRepositoryInterface; -use App\Services\SortingService; -use App\Services\AssetService; +use App\Services\Assets\AssetService; +use App\Services\Data\SettingsService; +use App\Services\Data\AuthService; +use App\Services\Data\SortingService; use function _\find; diff --git a/app/Http/Controllers/RouteController.php b/app/Http/Controllers/RouteController.php index 200e6cf..fbe3f93 100644 --- a/app/Http/Controllers/RouteController.php +++ b/app/Http/Controllers/RouteController.php @@ -2,7 +2,7 @@ namespace App\Http\Controllers; -use App\Services\AuthService; +use App\Services\Data\AuthService; use Illuminate\Http\Request; class RouteController extends Controller diff --git a/app/Http/Controllers/ThemeController.php b/app/Http/Controllers/ThemeController.php index 82a518a..5524588 100644 --- a/app/Http/Controllers/ThemeController.php +++ b/app/Http/Controllers/ThemeController.php @@ -3,10 +3,10 @@ namespace App\Http\Controllers; use App\Interfaces\PageRepositoryInterface; -use App\Services\AuthService; -use App\Services\SortingService; -use App\Services\AssetService; -use App\Services\ThemeService; +use App\Services\Assets\AssetService; +use App\Services\Data\AuthService; +use App\Services\Data\SortingService; +use App\Services\Data\ThemeService; class ThemeController extends Controller { diff --git a/app/Providers/FipamoServiceProvider.php b/app/Providers/FipamoServiceProvider.php index 4ee4b58..1fa80ab 100644 --- a/app/Providers/FipamoServiceProvider.php +++ b/app/Providers/FipamoServiceProvider.php @@ -3,20 +3,24 @@ namespace App\Providers; use Illuminate\Support\ServiceProvider; +//Repos use App\Repositories\PageRepository; use App\Interfaces\PageRepositoryInterface; -use App\Services\SettingsService; -use App\Services\AuthService; -use App\Services\ContentService; -use App\Services\PaginateService; -use App\Services\ThemeService; -use App\Services\DocService; -use App\Services\FileUploadService; -use App\Services\RenderService; -use App\Services\SortingService; -use App\Services\AssetService; -use App\Services\MaintenanceService; -use App\Services\InitService; +//Asset Services +use App\Services\Assets\AssetService; +use App\Services\Assets\DocService; +use App\Services\Assets\FileUploadService; +use App\Services\Assets\RenderService; +//Data Services +use App\Services\Data\SettingsService; +use App\Services\Data\AuthService; +use App\Services\Data\ContentService; +use App\Services\Data\PaginateService; +use App\Services\Data\ThemeService; +use App\Services\Data\SortingService; +//Upkeep Services +use App\Services\UpKeep\MaintenanceService; +use App\Services\UpKeep\InitService; class FipamoServiceProvider extends ServiceProvider { diff --git a/app/Repositories/PageRepository.php b/app/Repositories/PageRepository.php index d2df3ec..6afbfb3 100644 --- a/app/Repositories/PageRepository.php +++ b/app/Repositories/PageRepository.php @@ -3,12 +3,14 @@ namespace App\Repositories; use App\Interfaces\PageRepositoryInterface; -use App\Services\SettingsService; -use App\Services\ContentService; -use App\Services\PaginateService; -use App\Services\DocService; -use App\Services\SortingService; -use App\Services\RenderService; +//Asset Services +use App\Services\Assets\DocService; +use App\Services\Assets\RenderService; +//Data Services +use App\Services\Data\SettingsService; +use App\Services\Data\ContentService; +use App\Services\Data\PaginateService; +use App\Services\Data\SortingService; use Carbon\Carbon; class PageRepository implements PageRepositoryInterface diff --git a/app/Services/AssetService.php b/app/Services/Assets/AssetService.php similarity index 98% rename from app/Services/AssetService.php rename to app/Services/Assets/AssetService.php index c4e38f2..2162c26 100644 --- a/app/Services/AssetService.php +++ b/app/Services/Assets/AssetService.php @@ -1,6 +1,8 @@ +
+